jsonElemAt_ifString: Extract a string from a JSON array

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
jsonElemAt_ifString(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,\"hello\",null,\"bird\"]"
jsonElemAt_ifString(json, 1)
jsonElemAt_ifString(json, 0) == "null"

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