[ESS] TWITTER API environment variables

Patrick Connolly p_conno||y @end|ng |rom @||ng@hot@co@nz
Thu Apr 9 01:21:46 CEST 2020


I'm using the rtweet package which makes use of the Twitter API which
requires a token alluded to by an environment variable.

That environment variable is automatically set up from the Twitter web
site and takes the name TWITTER_<username> (where <username> is the
name of the user in block letters).  That worked fine on my work
computer where my username is 'work'.  When I copied that working
directory to my home computer, the environment variable became
TWITTER_HOME but the rtweet package was looking for
TWITTER_WORK. There was no error message: just a null result from the
search_users() function.

I tried editing the ~/.Renviron entry to
TWITTER_WORK=/home/home/.rtweet_token.rds

That worked for a short time but soon ceased working.  Then I noticed
a new entry had been automatically added to ~/.Renviron

TWITTER_HOME=/home/home/.rtweet_token1.rds

So now I had two environment variables which also worked for a short
time.

No such problem arises if R is run from the bash prompt or Rstudio,
but editing functions is so clunky that way.  I've used ESS for more
than 20 years and find it preferable.

R-3.6.3, ESS 17.11

Any ideas what could be causing the token connexion being lost
appreciated.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.



More information about the ESS-help mailing list