Just wondering, is there anyway to change character encoding of a R list object? I have a feeling that I will have to take some multiple steps but I am not sure. I have googled on the topic but I am not quite getting help from internet.
for instance, consider the following:
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)
the command
followers.object<-lookupUsers(start$getFollowerIDs(), includeNA=TRUE)
throws the following error:
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()).
How can I allow R to preserve the special characters when working with twitter? hope I edited it nicely...let me know if you want me to edit it again
thank you,