ToJSONarray: Transforms a data.frame into a JSON array in a format compatible with D3.js and Protovis
(source by: http://theweiluo.wordpress.com/2011/09/30/r-to-json-for-d3-js-and-protovis/)
Description
This function transforms a R data frame into a JSON array such that each row in R becomes an JSON object in the array.
Usage
ToJSONarray(dtf)
Arguments
dtf
this is a data.frame
Value
JSON array in a format compatible with D3.js and Protovis
Details
The rjson/RJSONIO packages convert a data frame into a JSON hashmap, in which each column of the data frame becomes a named array.