Whis200
November 1, 2022, 11:47am
1
When I download the first basic packages in R it tells me at the end in the console that the packages are successfully unpacked. But when I try to load them with the library() command it shows
Error in nchar (homedir) : Invalid multibyte string, element 1
It happens for all packages I have installed
Help would be really much appreciated
This problem seems similar to the following. It may help you, best wishes.
Hello! I'm new in R and I want to download a library but when I try I get this message: Error in nchar(homeDir) : invalid multibyte string, element 1
[image]
ps: My native language is Spanish, I don't know if that is relevant (even do I installed english R)
R has problems with multibyte characters in your package library path, I recommend you to set your package library in a folder with ASCII characters only.
You can change the default library folder by setting your R_LIBS_SITE environmental variable in a .Reviron or .Rprofile file. For example:
# In a .Renviron file you can set it by adding a line like this one with the desired location
R_LIBS_SITE="C:\\Program Files\\R\\R-4.2.1\\library"
For a more detailed explanation, you can read this blog post
In theory the latest R version should be able to handle non-ASCII characters but you would need to activate the experimental utf8 encoding support on Windows, which cames with unexpected issu…
system
Closed
November 22, 2022, 12:11pm
3
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.