[R] ggplot2 install.package

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Tue Oct 11 09:18:32 CEST 2022


On Mon, 10 Oct 2022 15:32:33 +0200
<sibylle.stoeckli using gmx.ch> wrote:

> Error in nchar(homeDir) : invalid multibyte string, element 1

I searched for nchar(homeDir) in the R source code and on CRAN (as
indexed by GitHub), and the only CRAN match was probably unrelated (in
the ibmdbR package).

There's also a few matches in the RStudio source code:
https://github.com/rstudio/rstudio/blob/3742521ab2e67528090358a42d9f13933f4400df/src/cpp/session/modules/SessionPackages.R

A search of "nchar(homeDir)" on RStudio website gives a lot of
seemingly relevant results.

However, I don't see them doing anything obviously wrong. This could be
related to stricter handling of invalid strings that was recently
improved in R:
https://blog.r-project.org/2022/10/10/improvements-in-handling-bytes-encoding/

What does path.expand("~/") return on your machine? What is Encoding(.)
of the value? What are its actual byte values, i.e. charToRaw(.)? What
is your sessionInfo()?

-- 
Best regards,
Ivan



More information about the R-help mailing list