multiple JSON objects in fromJSON

后端 未结 2 1433
無奈伤痛
無奈伤痛 2021-01-24 01:00

I\'m trying to use fromJSON() to read in a .json file with multiple objects structured as follows:

{ \"key11\": value11, \"key12\": value12 }
{ \"ke         


        
2条回答
  •  不思量自难忘°
    2021-01-24 01:34

    Assuming you know it's one per line, and no weird line breaks,

     lapply(readLines(filename), fromJSON, flatten = TRUE)
    

提交回复
热议问题