Dear all.
When using R version 4.6.1 on certain Windows platforms where the username
contains non-ASCII characters (such as "á"), the command:
path.expand("~")
fails with the following error:
Error: file name conversion problem -- name too long?
This occurs when the Windows OS does not define the R_USER environment
variable. In these cases, a call to Sys.getenv("R_USER") returns an
empty string ("").
However, if an .Renviron file is created with a valid path, such as:
R_USER="C:\Users\%Username%\Documents"
then path.expand() works properly no matter if which the %Username% is.
This error propagates to other functions that internally call path.expand(),
such as file.exists().
This behavior has been confirmed on multiple computers by various users running
Windows 10 and 11.
In my opinion, this is a bug, as a standard path expansion should not trigger a
conversion error under these circumstances. Or is this the
expected behavior in this scenario?
More info:
https://github.com/RCmdr-Project/rcmdr/issues/8
Thank in advance.
--
Manuel Muñoz Márquez <[email protected]>
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.