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')