[R] how to read a local JSON file
Ye Lin
yelin at lbl.gov
Sun Jun 7 07:50:13 CEST 2015
Hi All,
I downloaded a data file from dropbox and its in JSON format.
here is my code:
library(RJSONIO)
data <- fromJSON(file='C:/Users/Downloads/sample.json')
Lines <- readLines("C:/Users/Downloads/sample.json")
df <- as.data.frame(t(sapply(Lines, fromJSON)))
I got this error message:
incomplete final line found on 'C:/Users/Downloads/sample.json'
The file path is def correct, can anyone help me on this?
Thanks!
[[alternative HTML version deleted]]
More information about the R-help
mailing list