0

我正在使用 jsonlite 来解析 json 值。json 数据集包含 jsonlite 似乎没有解析的数组。

数据集:

{"basicException":[{"assembly":"WCFTestCalcModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","count":1,"method":"WCFTestCalcModel.ICalculator.AddNumbers","outerExceptionMessage":"Input string was not in a correct format."},{"parsedStack":[{"method":"System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage","assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","level":0,"line":0},{"method":"System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke","assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","level":1,"line":0}],"hasFullStack":true,"id":"12116171","outerId":"0","message":"Input string was not in a correct format.","count":0}],"internal":{"data":{"id":"f7ca6e6f-eed1-4a0c-8e12-c14374e286c6","documentVersion":"1.61"}}}

脚本:

x<- stream_in(file("E:\\Temp\\AzureErrorLog\\ErrorLog1-sub.json"))

我如何将这些数组值解析为数据框

谢谢

4

1 回答 1

0

因为 Json 是嵌套的,所以您不能将整个对象放入数据框中。您需要对其进行解析,然后将列表对象中的元素提取到数据框中。

于 2016-11-09T19:58:33.140 回答