Questions tagged [renviron]

9 questions
7
votes
3 answers

.Renviron variables not found when Rscript run from powershell?

I have an R script that runs perfectly when run from Rstudio. It uses an .Renviron file to provide environment variables which are visible in Sys.getenv() (so I know it works). However, when I run the exact same script via powershell, the R script…
stevec
  • 41,291
  • 27
  • 223
  • 311
5
votes
1 answer

stats package not found in R

I'm really having problems with RStudio. It had been working fine a few days ago. Then it said I needed the newest version of RTools. I tried to install it but don't think it was successful. However now I can't load anything in R. I am greeted with…
daisy
  • 61
  • 1
  • 6
2
votes
1 answer

RStudio and R have different `~` (Home) directories

I have just updated my R version from 4.1.1 to 4.2.2. My problem is that RStudio (2022.07.2) is not appearing to process the .Renviron file correctly. In other words, I get the following in the console: > path.expand("~") [1]…
James N
  • 315
  • 2
  • 9
1
vote
0 answers

Changing the temporary directory in R

First of all, I am aware of the following discussion covering the same topic. However, following the instructions, I can still somehow not change the temporary directory. I installed Anaconda for my local user and then installed R. When I try to…
Patrick Balada
  • 1,330
  • 1
  • 18
  • 37
0
votes
0 answers

System Renviron cannot find

I reinstalled my system (Fedora36), because of some hardware issues. A tried to run my C script embedded with some R-code which was running perfectly on the previous system (Fedora35). The make file runs smoothly, but running the program oneself I…
Fiser
  • 1
0
votes
0 answers

Unable to load any packages in R after installing rtools because "package 'stats' does not have a namespace"

Earlier today I was trying to install a package from github using the library_github command from the devtools package. However, I received an error that devtools could not be used because rtools was not installed. I tried to install rtools using…
0
votes
1 answer

Setting R's default behaviour in .Rprofile and .Renviron. Understanding what to do where

I am trying to understand the use of the files .Renviron and .Rprofile. If I understand correctly, the .Rprofile is sort of a startup script, sourced as R code, that sets the options and environment variables that a user may want either all the…
Pål Bjartan
  • 793
  • 1
  • 6
  • 18
0
votes
0 answers

Adding .Renvrion to github repo hiding from public

If it is a duplicate I am sorry, however I've read lots of threads and none of them worked and only a few of them were related to R. I want to automate an R script using github actions. So doing that I need to pass some keys, tokens and etc. However…
badalovi
  • 124
  • 8
0
votes
1 answer

.rprofile not source when creating RStudio project

In Windows 7, I have my .Rprofile in a custom location (not R_HOME, not HOME). I informed the OS of this location via the user environment variable R_ENVIRON_USER pointing to this location. There is no other .Rprofile anywhere else. In RStudio, I…
Thomas Speidel
  • 1,369
  • 1
  • 14
  • 26