jsonElemAt_ifBool: Extract a Boolean from a JSON array

Description Usage Arguments Value See Also Examples

Description

Returns the Boolean in a JSON array by giving its index; returns "null" if there is no Boolean at this index.

Usage

1
jsonElemAt_ifBool(json, index, toJSON = FALSE, fromJSON = FALSE)

Arguments

json

JSON string

index

integer

toJSON

logical, whether to apply toJSON to the input

fromJSON

logical, whether to apply fromJSON to the output

Value

A JSON string if fromJSON=FALSE, a R object if fromJSON=TRUE.

See Also

jsonElemAt, jsonAccess

Examples

1
2
3
json <- "[1,true,null,\"bird\"]"
jsonElemAt_ifBool(json, 1)
jsonElemAt_ifBool(json, 0) == "null"

stla/jsonAccess documentation built on May 30, 2019, 5:47 p.m.