jsonedit | R Documentation |
Lists
with 'jsoneditor'
jsonedit
provides a flexible and helpful interactive tree-like view of lists
or really any R dataset that can be represented as JSON
.
Eventually, this could become a very nice way to not only view but also modify R data using
Shiny.
jsonedit(
listdata = NULL,
mode = "tree",
modes = c("text", "tree", "table"),
...,
width = NULL,
height = NULL,
elementId = NULL
)
listdata |
|
mode |
|
modes |
|
... |
|
width |
integer in pixels defining the width of the |
height |
integer in pixels defining the height of the |
elementId |
character to specify valid |
library(listviewer)
# using the data from the jsoneditor simple example
# in R list form
jsonedit(
list(
array = c(1,2,3)
,boolean = TRUE
,null = NULL
,number = 123
,object = list( a="b", c="d" )
,string = "Hello World"
)
)
# jsonedit also works with a JSON string
jsonedit(
'{"array" : [1,2,3] , "boolean" : true, "null" : null, "number": 123}'
)
# also works with most data.frames
jsonedit( mtcars )
# helpful interactive view of par
jsonedit( par() )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.