I was following the vignette for the package, updated and loaded all necessary packages, seemed like it would be a pretty straight-forward process to authenticate. Instead,
I tried all the suggestions here but surprisingly none worked for me. Somebody could be going through the same situation as I did so I answer with what worked for me- it seems that the problem was with direct authentication, so I followed the following steps(this requires one to have the openssl package) installed and loaded along with the twitteR package;
Ensure you have created your twitter API and have the consumerkey and consumerSecret codes, and preferably remain logged into twitter with your default web browser
packages <- c("twitteR", "openssl")
### checking if packages are already installed and installing if not
for(i in packages){
if(!(i %in% installed.packages()[, "Package"])){
install.packages(i)
}
library(i, character.only = TRUE) ## load packages
}
setup_twitter_oauth(consumer_key, consumer_secret) ## do not input the access_token and access_secret
This is going to open up your default browser with the successful authentication message. You can close the browser now and continue exploring tweets with R.