Learn R Programming

jsontools (version 0.1.0)

json2: Construct a json2 object

Description

new_json2() is a fast, low-level constructor that takes a character vector. json2() checks the input for validity. as_json2() and is_json2() are simple forwarders to vctrs::vec_cast() and vctrs::vec_is() respectively.

Usage

json2(x = character())

new_json2(x = character())

as_json2(x)

is_json2(x)

Arguments

x

A character vector.

Value

A json2 vector.

Examples

Run this code
# NOT RUN {
json2()
json2('{"abc": 1}')

new_json2()
new_json2('{"abc": 1}')
new_json2(c('{"abc": 1}', '{"def": 2}', "[1, 2, 3]", NA))
# }

Run the code above in your browser using DataLab