1

I have installed tidyverse but whenever I try to load it either by typing library(tidyverse) or by selecting it from the list of packages in the environment pane I get this error message:

Error: package or namespace load failed for ‘tidyverse’ in get(Info[i, 1], envir = env):
 cannot open file 'C:/Users/MyName/Documents/R/win-library/4.0/rlang/R/rlang.rdb': No such file or directory

In the file path above, however, my name has been spelled incorrectly as my name has an accent above one of the vowels and it appears that RStudio has been unable to process this correctly. Could this be the cause of the issue and if so is there a way around it? I have tried changing the working directory to the file path mentioned in the error message but this did not help anything.

I am also having trouble creating RMarkdown files. When I click 'Knit' I get a similar error message:

Error in get(Info[i, 1], envir = env) : 
  cannot open file 'C:/Users/MyName/Documents/R/win-library/4.0/evaluate/R/evaluate.rdb': No such file or directory
Calls: :: ... asNamespace -> loadNamespace -> registerS3methods -> get
Execution halted 

I recently downloaded R4.0 and RStudio 1.2.5042 if that makes any difference. Any help at all would be appreciated.

Phil
  • 7,287
  • 3
  • 36
  • 66
Shout
  • 21
  • 5
  • try .libPaths('C:/Users/MyName/Documents/R/win-library/4.0) with your name and reload your libraries. Maybe this will fix it up – Levon Ipdjian May 05 '20 at 10:22
  • 1
    Have you tried installing it with dependencies:install.packages("tidyverse", dependencies = TRUE) – rj-nirbhay May 05 '20 at 10:24
  • Hi @NirbhaySingh, I just tried that, succesfully installed it and received this error message upon trying to load it: Error: package or namespace load failed for ‘tidyverse’ in get(Info[i, 1], envir = env): cannot open file 'C:/Users/Pádraig/Documents/R/win-library/4.0/rlang/R/rlang.rdb': No such file or directory – Shout May 05 '20 at 13:20
  • When I install tidyverse package I get this message: The downloaded binary packages are in C:\Users\MyName\AppData\Local\Temp\RtmpUvXj14\downloaded_packages When I try to load them it tells me: Error: package or namespace load failed for ‘tidyverse’ in get(Info[i, 1], envir = env): cannot open file 'C:/Users/Pádraig/Documents/R/win-library/4.0/rlang/R/rlang.rdb': No such file or directory. Should the file paths be different here? – Shout May 05 '20 at 13:25
  • Hi @LeonIpdjian, thank you for your reply. I'm afraid I don't understand what you mean by 'try .libPaths('C:/Users/MyName/Documents/R/win-library/4.0) with your name and reload your libraries' - could you please explain it further? – Shout May 05 '20 at 14:06
  • Hello, no problem. Just run .libPaths('C:/Users/MyName/Documents/R/win-library/4.0) in the console, then try to run your libraries. – Levon Ipdjian May 05 '20 at 14:09
  • @Shout In simple words: When a user installs any package, it gets stored at one place in your machine and during the load of installed package R tries to refer to that location. Usually, the user doesn't get the errors that you are getting this might be due to some path break or change in the default location of R during the installation of R. So the user has to set up the correct path for the R using .libPaths syntax which is .libPaths("location of the correct path") which would be as suggested by Leon – rj-nirbhay May 05 '20 at 14:37
  • @NirbhaySingh and Leon thank you both for your help. I still have not solved it unfortunately. I have reset my library path as suggested. Now when I try to load tidyverse I get this error message: Error in library(tidyverse) : there is no package called ‘tidyverse’ even though I have just installed it. – Shout May 05 '20 at 15:18
  • @Shout can you share the output of this syntax: ` .libPaths() ` this might be helpful - https://stackoverflow.com/questions/15170399/change-r-default-library-path-using-libpaths-in-rprofile-site-fails-to-work – rj-nirbhay May 05 '20 at 15:26
  • Hi @NirbhaySingh, this is the output when I run ''libPaths()' : [1] "C:/Users/MyName/Documents/R/win-library/4.0" [2] "C:/Program Files/R/R-4.0.0/library" Thank you for the link, I will check it out now. – Shout May 05 '20 at 16:15
  • so it shows that you have 2 R libraries. so you have to choose one path to do both install and load pf package. steps would be step 0: run .libPaths("location1") step1: install.package(pkg name, dependencies =T) step 2 : library(pkg name) – rj-nirbhay May 05 '20 at 16:27
  • @NirbhaySingh thanks for your reply. I noticed when I installed tidyverse that it was being installed in this location: ‘C:\Users\MyName\AppData\Local\Temp\RtmpeKC9w8\downloaded_packages’ I then tried choosing this location as the correct path. When I tried to load tidyverse I got this error message: Error in library(tidyverse) : there is no package called ‘tidyverse’ I also tried your advice in your most recent comment and it didn't work unfortunately. – Shout May 05 '20 at 17:26
  • @Shout the error is related to the location only. Try to check at the link mentioned previously – rj-nirbhay May 05 '20 at 17:49
  • @Shout I think this will hlep you for sure :https://stackoverflow.com/questions/31707941/how-do-i-change-the-default-library-path-for-r-packages – rj-nirbhay May 06 '20 at 03:18
  • @NirbhaySingh, I have now tried updating R_LIBS_USER but it is still not working for me unfortunately. I tried to install tidyverse again with dependencies and I get a new error message this time: Warning in install.packages : 'lib = "C:/Program Files/R/R-4.0.0/library"' is not writable Error in install.packages : unable to install packages Thanks very much for your help so far. – Shout May 06 '20 at 15:56

0 Answers0