只是想知道,有没有改变 R 列表对象的字符编码?我有一种感觉,我将不得不采取多个步骤,但我不确定。我已经用谷歌搜索了这个主题,但我并没有从互联网上获得帮助。
例如,考虑以下内容:
library(twitteR)
library(RJSONIO)
#Authorize with Twitter's API
reqURL <- "https://api.twitter.com/oauth/request_token"
accessURL <- "http://api.twitter.com/oauth/access_token"
authURL <- "http://api.twitter.com/oauth/authorize"
consumerKey = "myconsumerkey"
consumerSecret = "myconsumersecret"
twitCred <- OAuthFactory$new(consumerKey=consumerKey,
consumerSecret=consumerSecret,
requestURL=reqURL,
accessURL=accessURL,
authURL=authURL)
twitCred$handshake()
B<-read.csv("BCorp RAW.csv")
handles<-B$Twitter.handle
handles<-na.omit(handles)
start <- getUser(handles[12])
library(rjson)
friends.object<- lookupUsers(start$getFriendIDs(), includeNA=TRUE)
followers.object<-lookupUsers(start$getFollowerIDs(), includeNA=TRUE)
命令
followers.object<-lookupUsers(start$getFollowerIDs(), includeNA=TRUE)
引发以下错误:
Error in twFromJSON(out) :
Error: Malformed response from server, was not JSON.
The most likely cause of this error is Twitter returning a character which
can't be properly parsed by R. Generally the only remedy is to wait long
enough for the offending character to disappear from searches (e.g. if
using searchTwitter()).
使用 twitter 时如何允许 R 保留特殊字符?希望我编辑得很好......如果你想让我再次编辑它,请告诉我
谢谢你,