R has a JSON package

November 5, 2009
By

(This article was first published on What You're Doing Is Rather Desperate » R, and kindly contributed to R-bloggers)

Named rjson, appropriately. It’s quite basic just now, but contains methods for interconversion between R objects and JSON. Something like this:

> library(rjson)
> data <- list(a=1,b=2,c=3)
> json <- toJSON(data)
> json
[1] "{"a":1,"b":2,"c":3}"
> cat(json, file="data.json")

Use cases? I wonder if RApache could be used to build an API that serves R data in JSON format?


Posted in computing, R, statistics Tagged: cran, json, r-project, statistics

To leave a comment for the author, please follow the link and comment on his blog: What You're Doing Is Rather Desperate » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , , ,

Comments are closed.