json_u: Unbox a vector or data frame

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Mark a vector of length one to not be wrapped in an array when formatted as JSON. This is only a tiny wrapper around jsonlite::unbox() to avoid conflict with rlang::unbox().

Usage

1
json_u(x)

Arguments

x

atomic vector of length 1, or data frame with 1 row.

Value

A singleton version of x.

Examples

1
2
format_json(list(foo = 123))
format_json(list(foo = json_u(123)))

jsontools documentation built on March 22, 2021, 5:06 p.m.