Reading a huge json file in R , issues

后端 未结 3 1217
北荒
北荒 2020-12-30 11:17

I am trying to read very huge json file using R , and I am using the RJSON library with this commend json_data <- fromJSON(paste(readLines(\"myfile.json\"), collaps

3条回答
  •  囚心锁ツ
    2020-12-30 11:43

    I got the same problem while working with huge datasets in R.I had used jsonlite package in R for reading json in R.I had used the following code to read json in R:

    library(jsonlite)
    get_tweets <- stream_in(file("tweets.json"),pagesize = 10000)
    

    here tweets.json is the my file name and the location where it exists,pagesize represents how many number of lines it reads in one iteration.Hope it helps.

提交回复
热议问题