0

I am very new to R and I am using J Stanton "Data Science with R" to connect to twitter. I have run the connection and it works but I dont want to run my credential command and type in my PIN code everytime I run the script.

I the book it says I dont have to do this as long as I "save the credential data object and restore it in future sessions".

How do I do this?

user1966593
  • 69
  • 10

1 Answers1

1

I worked through the same code too, the solution is pretty simple: Save the returned object to an RData file

credential <- OAuthFactory$new(consumerKey=my.key, ....)
credential$handshake()
save(credential,file = "credential.RData")

Next time you run the code, check for the presence of the file, if there, read it it and use that object instead. As an example, take a look at my take on the code you are working through: https://gist.github.com/binalytics/6504845

Andrew Dempsey
  • 190
  • 1
  • 12