json.collapse | R Documentation |
collapse columns in a dataframe to a single JSON column
json.collapse(data, field, colNames)
data |
dataframe containing one or more columns |
field |
name to give JSON column |
colNames |
a single or an array of column names to convert to JSON records |
# Multiple columns
data = json.collapse(data, "newField", c("field1","field2"))
# OR single column
data = json.collapse(data, "newField", "field1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.