5
Rリストオブジェクトの文字エンコーディングを変更する方法はありますか? 私はいくつかのステップを取らなければならないと感じていますが、わかりません。 私はその話題を尋ねましたが、私はインターネットからの助けを得ていません。例えば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)
は、次のエラーがスローされます。
私はときRは、特殊文字を維持できるようにすることができますどのように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()).
ツイッターで作業していますか?私はきれいにそれを編集した 希望は...私はあなたが私は再び
を、それを編集したい場合は、文字ベクトルのエンコーディングを指定することができますEncoding<-
機能があり、
[再現可能な例](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)を提供して、あなたの質問を少し詳しく説明できますか?何を期待していますか? –
いいえ、RはデフォルトでUTF-8以外の文字をUTF-8(あるいはおそらく '"不明 "")に変換するので、最初の場所で*どのようにデータをRに入れるかを示す良い例を考え出す必要があります。 )。 '[1] 'UTF-8''を与える 'Encoding("£ ")'をチェックしてください。 –
それは良いですか?私の生データが.csvファイルにあるので、実際のデータを実際に追加することはできません。 –