json_u: Unbox a vector or data frame

View source: R/utils.R

json_uR Documentation

Unbox a vector or data frame

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

json_u(x)

Arguments

x

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

Value

A singleton version of x.

Examples

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

mgirlich/jsontools documentation built on March 21, 2023, 9:10 a.m.