I am trying to do sentiment analysis in R using twitter data and below is my code for it:
install.packages("twitteR") install.packages("ROAuth") library(twitteR);library(ROAuth); # Download "cacert.pem" file download.file(url="http://curl.haxx.se/ca/cacert.pem",destfile="cacert.pem") #create an object "cred" that will save the authenticated object that we can use for later sessions cred <- OAuthFactory$new(consumerKey='xxcxcxcx', consumerSecret='vnbvnbvbv, requestURL='https://api.twitter.com/oauth/request_token', accessURL='https://api.twitter.com/oauth/access_token', authURL='https://api.twitter.com/oauth/authorize') # Executing the next step generates an output --> To enable the connection, please direct your web browser to: <hyperlink> . Note: You only need to do this part once cred$handshake(cainfo="cacert.pem") #save for later use for Windows save(cred, file="twitter authentication.Rdata") load("twitter authentication.Rdata") registerTwitterOAuth(cred)
However this gave me an error:
which i found out is because we can use the below option:
in place of Routh,but even this is giving an error:
Why is this error coming and how do i rectify it??