Lui*_*tas 5 r gsub facebook-graph-api rjsonio rjson
当我尝试从Facebook URL中解析角色对象中的JSON时,我得到了"来自jSON(数据)的错误:意外的转义字符'\ o'at pos 130".看一下这个:
library(RCurl)
library(rjson)
data <- getURL("https://graph.facebook.com/search?q=multishow&type=post&limit=1500", cainfo="cacert.perm")
fbData <- fromJSON(data)
Error in fromJSON(data) : unexpected escaped character '\o' at pos 130
#with RSONIO also error
> fbData <- fromJSON(data)
Erro em fromJSON(content, handler, default.size, depth, allowComments, :
invalid JSON input
Run Code Online (Sandbox Code Playgroud)
在我尝试解析JSON之前,有没有办法替换这个'\ o'字符?我尝试过gsub,但它没有用(或者我做错了).
datafixed <- gsub('\o',' ',data)
Error: '\o' is an unrecognized escape sequence in string starting with "\o"
Run Code Online (Sandbox Code Playgroud)
有人可以用这个帮我吗?谢谢.
| 归档时间: |
|
| 查看次数: |
3405 次 |
| 最近记录: |