我的字符串如下。
[{\"period\":\"01-06-2018\",\"count\":5},{\"period\":\"01-07-2018\",\"count\":8},{\"period\":\"01-08-2018\",\"count\":9}]
但是我只希望(仅反斜杠)被删除,它应该如下所示 (使用 R编程函数)
[{"period":"01-06-2018","count":5},{"period":"01-07-2018","count":8},{"period":"01-08-2018","count":9}]
答案 0 :(得分:0)
这应该做到:
library(tidyverse)
somestring<-c("[{\"period\":\"01-06-2018\",\"count\":5},{\"period\":\"01-07-2018\",\"count\":8},{\"period\":\"01-08-2018\",\"count\":9}]")
library(jsonlite)
fromJSON(somestring)
这将产生:
period count
1 01-06-2018 5
2 01-07-2018 8
3 01-08-2018 9