gist: dfToJSON

Tweet about this on TwitterShare on LinkedInShare on FacebookGoogle+Share on StumbleUponEmail to someone

I’ve been using a lot of javascript charting and visualisation libraries recently (e.g. D3, highcharts) and found that it is quite painful to get my data into the JSON structure required by each library. Since I’m doing most of the data manipulation in R anyway it makes sense to arrange the data as a nested list in R and then transform it to JSON using rJSON. In this function I’ve catered for the structures needed for most of the highcharts data, however many other structures could easily be added.

Machine Learning and Analytics based in London, UK