It returns a string that contains an array of objects. There are as many JS objects as there are rows in the data frame. The column names are used as the keys of each object. The objects are separated by newlines.
df2json(df)
library(df2json) df <- data.frame(name=c("a", "b", "c"), x=c(NA, 2 ,3), y=c(10, 20, -Inf), show=c(TRUE, FALSE, TRUE)) df2json(df)
Run the code above in your browser using DataLab