Пример взят из документации пакета jsonlite
(пакет используется в httr
для обработки jsons):
library(jsonlite)
# Stringify some data
jsoncars <- toJSON(mtcars, pretty=TRUE)
cat(jsoncars)
# Parse it back
fromJSON(jsoncars)
# Parse escaped unicode
fromJSON('{"city" : "Z\\u00FCrich"}')
РЕДАКТИРОВАТЬ : с предоставленными данными:
# --- with provided data
library(jsonlite)
dframe <- jsonlite::fromJSON(txt = "question_so_json.json")
dframe
# Run this to write csv
utils::writes.csv(x = dframe, file = "mydata.csv")
данные
[{
"Status":"COMPLIANT",
"InstalledTime":"",
"ExecutionType":"",
"PatchSeverity":"",
"Title":"",
"Severity":"UNSPECIFIED",
"ExecutionTime":"2019-05-22T12:46:53Z",
"captureTime":"2019-05-22T12:46:58Z",
"schemaVersion":"1.0"
},
{
"Status":"COMPLIANT",
"InstalledTime":"2014-03-18T00:00:00.0000000Z",
"ExecutionType":"Command",
"PatchSeverity":"Critical",
"Title":"Windows (KB2919355)",
"Severity":"UNSPECIFIED",
"ExecutionTime":"2019-05-22T11:56:58Z",
"captureTime":"2019-05-22T12:46:58Z",
"schemaVersion":"1.0"
},
{
"Status":"COMPLIANT",
"InstalledTime":"2014-10-15T00:00:00.0000000Z",
"ExecutionType":"Command",
"PatchSeverity":"Important",
"Title":"Security (KB2977765)",
"Severity":"UNSPECIFIED",
"ExecutionTime":"2019-05-22T11:56:58Z",
"captureTime":"2019-05-22T12:46:58Z",
"schemaVersion":"1.0"
}]