R语言操作JSON

最后发布时间:2024-01-24 16:04:47 浏览量:
library(rjson)

json_string <- '{"name": "John", "age": 30}'
data <- fromJSON(json_string)
data$name <- "test"
data$newKey <- "123"



r_obj <- list(name = "John", age = 30, married = TRUE)
json_str <- toJSON(r_obj)
write(json_str, file = "student.json")


student <- fromJSON(file='student.json')

快捷入口
R 思维导图 浏览PDF 下载PDF
分享到:
标签