powered by
Unserialize data frame columns that contain JSON
unpack_json_cols(x, cols)# S3 method for data.table unpack_json_cols(x, cols)# S3 method for data.frame unpack_json_cols(x, cols)
# S3 method for data.table unpack_json_cols(x, cols)
# S3 method for data.frame unpack_json_cols(x, cols)
a data.frame with additional columns expanded from the columns containing JSON
data.frame
a data.frame
character vector. The names of the text columns containing JSON strings that should be expanded.
character
x <- data.frame( name = "example data", fields = '{"letters":["a","b","c"], "LETTERS":["A","B","C"]}', stringsAsFactors = FALSE ) res <- unpack_json_cols(x, "fields") res res$letters[[1]]
Run the code above in your browser using DataLab