Search code examples
rlinuxtwittercentos7rtweet

rtweet create_token missing value where TRUE/FALSE needed


So I have been collecting tweets for some months on an external Linux Centos 7.6.1810 server but for some reasons, I can not do it anymore.

So my code is

consumer_key = 'xxx'
consumer_secret = 'xxx'
access_token = 'xxx'
access_secret = 'xxx'

options(httr_oauth_cache=T)
rtweet::create_token(
  app = "appname",
  consumer_key = consumer_key,
  consumer_secret = consumer_secret,
  access_token = access_token,
  access_secret = access_secret)

It has been working fine for months but some reasons, now I get the error

Error in if (file == "") stop("'file' must be non-empty string") : missing value where TRUE/FALSE needed

If i look at the parameters of the function create_token, the only parameter that I haven't put is set_renv but even with that parameter, it does not work. However, it work fine on my local windows computer... any suggestions?


Solution

  • I had the same issue.

    The culprit was the file .rtweet_token.rds which is created every time the authentication is required. Actually, if the file already exists, then a new file is created by appending a number to it (.rtweet_token1.rds , .rtweet_token2.rds, etc).

    It happened that I already had 1000 instances of these files and for some reason a new file was not being created.

    The solution was to delete all the instances of the file.