multiple JSON objects in fromJSON

后端 未结 2 1432
無奈伤痛
無奈伤痛 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:24

    if you read references: the option unexpected.escape is available.

    unexpected.escape changed handling of unexpected escaped characters. Handling value should be one of "error", "skip", or "keep"; on unexpected characters issue an error, skip the character, or keep the character

    0 讨论(0)
  • 2021-01-24 01:34

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

     lapply(readLines(filename), fromJSON, flatten = TRUE)
    
    0 讨论(0)
提交回复
热议问题