[R] Reading multiple line from a JSON formatted file

Shelby McIntyre smcintyre at scu.edu
Sun Jul 8 15:50:36 CEST 2012

Below is R code that successfully reads the first line of a JSON file (attached). 
However, it is supposed to read 5 lines of the file, not just one.  What is the 

>json_file <- "/Users/smcintyremobile/Google Drive/AAShelby/CORRESP/Services Research/eWoM references for Ed/yelp_academic_dataset SAMPLE.txt" 
>json_data <- fromJSON(paste(readLines(json_file,n=5), collapse="")) 
[1] 1 

[1] 8 

[1] 1 

[1] "TFm6azL9LLpljgVKx-Vfkw" 

[1] "E L." 

[1] "http://www.yelp.com/user_details?userid=TFm6azL9LLpljgVKx-Vfkw" 

[1] 3.5 

[1] 12 

[1] "user" 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Yelp-academic-dataset SAMPLE.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120708/407631fe/attachment.txt>

More information about the R-help mailing list