Error message in RStudio related to my account name in Windows

Viewed 58

When trying to use RStudio and installing packages, I get the following error messages:

Error in nchar(homeDir) : invalid multibyte string, element 1
In normalizePath(path.expand(path), winslash, mustWork) : path[1]="C:/Users/J�r�me/Documents": Le chemin d’accès spécifié est introuvable.

I’ve looked online and contacted different people for help, but without any success. The only solution I found was this line of code that doesn't work ""Sys.setlocale( 'LC_ALL','C' ) ""

I am at a loss and need to use this program both for my masters project and for some classes. Any help is greatly appreciated.

1 Answers

There seems to be a problem with Multibyte Characters (like á or Ô). Ref here

I guess homeDir is a variable created by you, and not R's home directory.( Which can be found by running R.home() )

I think you might be able to avoid this problem if you do not use user-specific locations like the Documents folder. Instead, create a folder directly on the root of drive. For example - make a folder D:\Rprojects , and place both your scripts and data within that folder. Windows user name will not come into picture when dealing with this path.

As for setting locale to C, the C locale copies the default for C programming language and is North-American centric as per the documentation. You can try setting locale to fr. See this reference

Related