Description Usage Arguments Value See Also Examples
Returns a sub-array of a JSON array by giving the desired indices.
1 | jsonElemsAt(json, indices, toJSON = FALSE, fromJSON = FALSE)
|
json |
json string |
indices |
integer vector |
toJSON |
logical, whether to apply |
fromJSON |
logical, whether to apply |
A json string if fromJSON=FALSE
, a R object if fromJSON=TRUE
.
1 2 3 4 5 6 7 | json <- "{\"a\":{\"b\":8,\"c\":[0,1,\"hello\"]},\"b\":null}"
( arr <- jsonAccess(json, c("a","c")) )
jsonElemsAt(arr, c(0,2))
jsonElemsAt(arr, 2)
jsonElemsAt(arr, c(1,3))
# chain with the pipe operator:
jsonAccess(json, c("a","c")) %>% jsonElemsAt(2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.