I'm to trying to run an r-script from the command line. The script prompts a "1"/"2" input. How can I automate the answer to be 2 via a batch file?
In particular, I have the file "run.R" with the following script within:
require(twitteR)
oauth <- setup_twitter_oauth(cred$consumerKey, cred$consumerSecret, cred$accessToken, cred$accessTokenSecret)
# more code...
When running the above script from the command line - Rscript run.R
- the function setup_twitter_oauth
prompts the following:
[1] "Using direct authentication"
Use a local file to cache OAuth access credentials between R sessions?
1: Yes
2: No
Selection:
How can I automate the answer to be 2 when running the script from the command line or through a batch file?