How set new path to the newly Updated RTools40?

434 Views Asked by At

After updating R to 4.0.3 and RStudio to the newest version, I have issues with the cointegration of RStudio and RTools described in these questions (before R was 3.6 and RTools 35 and everything worked fine): https://community.rstudio.com/t/problems-with-r-4-0-0-windows-error-package-or-namespace-load-failed-for-stats-in-indl-x-as-logical-local-as-logical-now/62958/6

https://community.rstudio.com/t/rtools-not-found-after-r-4-0-0-installation/63356/3

I found that I should set some environmental variables for my user. However, I do not understand how to do it, despite the fact that the new path to RTolls should have path C:\rtools40\usr\bin (with older Rtools version it is C:\RTools\bin. Could you help with that?

Additionally,I did these steps, but then got error when downloading package

> Sys.setenv(PATH = paste("C:/rtools40/usr/bin", Sys.getenv("PATH"), sep=";"))

> install_github("brettjbush/R-Websockets")
Downloading GitHub repo brettjbush/R-Websockets@HEAD
√  checking for file 'C:\Users\NAME\AppData\Local\Temp\RtmpSMB4KM\remotes2bcc582622c6\brettjbush-R-Websockets-fc7ee9c/DESCRIPTION' (598ms)
-  preparing 'websockets':
√  checking DESCRIPTION meta-information ... 
-  cleaning src
   Warning in system2(command, args, stdout = NULL, stderr = NULL, ...) :
     'CreateProcess' failed to run 'C:\rtools40\usr\bin\make.exe -f "C:/PROGRA~1/R/R-40~1.3/share/make/clean.mk" -f Makevars.win clean'

Then I tried following and got different error

> Sys.setenv(PATH = paste("C:/rtools40/usr/bin", Sys.getenv("PATH"), sep=";"))
> Sys.setenv(BINPREF = "C:/rtools40/mingw_$(WIN)/bin/")
> install_github("brettjbush/R-Websockets")
Downloading GitHub repo brettjbush/R-Websockets@HEAD
brettjbush-R-Websockets-fc7ee9c/man/websocket_close.Rd: truncated gzip input
tar.exe: Error exit delayed from previous errors.
Error: Failed to install 'websockets' from GitHub:
  Does not appear to be an R package (no DESCRIPTION)
In addition: Warning messages:
1: In utils::untar(tarfile, ...) :
  ‘tar.exe -xf "C:\Users\NAME\AppData\Local\Temp\RtmpSMB4KM\file2bccd21558.tar.gz" -C "C:/Users/NAME/AppData/Local/Temp/RtmpSMB4KM/remotes2bcc2b6a75d4"’ returned error code 1
2: In system(cmd, intern = TRUE) :
  running command 'tar.exe -tf "C:\Users\NAME\AppData\Local\Temp\RtmpSMB4KM\file2bccd21558.tar.gz"' had status 1


0

There are 0 best solutions below