Is there a way other than below to load a json.rows file into RStudio?

后端 未结 1 1591
醉酒成梦
醉酒成梦 2021-01-14 18:44

I have a json.rows file -> instances.json.rows with approximately 223k rows

I tried using jsonlite and came up with

instancesfile <- fromJSON(\"inst

1条回答
  •  北海茫月
    2021-01-14 19:23

    out <- lapply(readLines("instances.json.rows"), fromJSON)
    

    Congrats out is what you want it to be. The L apply applies the fromJSON function to each member returned from readLines and returns the results to out. I miss Spoke a bit in my comment, to make your file valid json you would have to replace the newlines with comma, then put the result where the * is in the below example. But that's all non-sense, just use the above one liner.

    {"data":[*]}
    

    0 讨论(0)
提交回复
热议问题