R version 4.0.1, already installed rtools 40, errors installing packages, eg. devtools,

I've already followed the instructions in https://cran.r-project.org/bin/windows/Rtools/ for rtools40 installation suposedly needed to build R packages, not missing the ' Putting Rtools on the PATH' section.

But I keep finding error messages when trying to install devtools (or any other package) and also trying to call the package with library() command. I have read in FAQ forums that the reason could be in the environment variables and the PATH but I haven't been able to solve the problem. Any help would be very useful. (This is my first time using R or any ther language). Than you in advance! :pray:

My code:

> install.packages("devtools")
Installing package into ‘C:/Users/Carlos Rohán/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
probando la URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/devtools_2.3.0.zip'
Content type 'application/zip' length 350911 bytes (342 KB)
downloaded 342 KB

package ‘devtools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\Carlos Rohán\AppData\Local\Temp\RtmpYjdLEs\downloaded_packages
Error in fetch(key) : 
  no fue posible abrir el archivo 'C:/Users/Carlos Rohán/Documents/R/win-library/4.0/devtools/help/devtools.rdb': No such file or directory
> library(devtools)
Loading required package: usethis
Error: package or namespace load failed for ‘usethis’ in get(Info[i, 1], envir = env):
 no fue posible abrir el archivo 'C:/Users/Carlos Rohán/Documents/R/win-library/4.0/fs/R/fs.rdb': No such file or directory
Error: package ‘usethis’ could not be loaded

NOTE: I have installed R, RStudio and rtools40 all in the same directory in the C drive:

C:\R\rtools40

R has problems with non-ASCII characters and empty spaces in your windows user name, either change your username or install into the system level package library instead.

1 Like

The problem may be that your user name in Windows has the character á. R seems to struggle with this, judging from the problems I have seen on this forum. Notice one of the errors is

no fue posible abrir el archivo 'C:/Users/Carlos Rohán/Documents/R/win-library/4.0/devtools/help/devtools.rdb'

R is looking for a directory that does not exist. Can you try either making a new user on your computer with no accented characters or spaces in the user name? Or you can try installing the packages into the site library instead of the user library.

You can see the available libraries with the command

.libPaths()

I am not on a Windows machine at the moment so I cannot tell you just what the output will be but there should be at least one library listed that does not use your user name. You can then use that as the lib argument in install.packages

1 Like

Thank you! :pray:, the question has been solved changin the name of the users folder :grinning:

Yes! You are right, I renamed the users folder and it works correctly now! ok_hand:t3: Thnx alot! :pray:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.