Handle JSON file format
Post date: Jun 22, 2014 8:29:13 PM
Using the R package RJSONIO from
http://cran.r-project.org/web/packages/RJSONIO/RJSONIO.pdf
Here is some example:
## Example on reading/writing in JSON format myList <- list(1L, c("a", "b"), c(FALSE, FALSE, TRUE), rnorm(3), runif(7)) ## write list to JSON myJSON <- toJSON(myList, digits = 4) ## display JSON cat(myJSON) ## write to JSON file write(myJSON,file='myJSON.json') ## import JSON file to R inJSON <- fromJSON('myJSON.json') class(inJSON)