Learn R Programming

mudata (version 0.1.1)

expand.tags: Expand JSON to multiple columns

Description

Expands a character vector of JSON values or a data.frame with a column tagcolumn to a data.frame with columns for each key in the vector of JSON objects. If x is a mudata object, the operation will be performed on the entire object.

Usage

expand.tags(x, ...)

# S3 method for data.frame expand.tags(x, tagcolumn = "tags", lazy = FALSE, ...)

# S3 method for mudata expand.tags(x, ...)

Arguments

x

a vector of JSON values or a data.frame with a 'tags' column

...

Passed to/from methods

tagcolumn

the column containing json

lazy

Don't preform expantion if tagcolumn exists in x

Value

A data.frame with columns added

Examples

Run this code
# NOT RUN {
data(pocmaj)
condensed <- condense.tags(pocmaj, tagcolumns = c("Ca", "Ti", "V"))
expand.tags(condensed)

# }

Run the code above in your browser using DataLab