Skip to content

ggplot2 install.package

5 messages · Ebert,Timothy Aaron, sibyiie@stoeckii m@iii@g oii gmx@ch, Spencer Graves +1 more

#
Dear R members

 

I am working with RStudio R 4.2.0 and using ggplot2 and gridExtra. 

Since some windows updates I get some error when loading  ggplot2.

*	It seems that I am able to install ggplot2. The problem is when
loading ggplot2 with library().
*	Do you have any ideas to solve the problem?

 

 

Kind regards

Sibylle

 

****************************************************************************
******************************

install.packages("ggplot2", dependencies = TRUE)

WARNING: Rtools is required to build R packages but is not currently
installed. Please download and install the appropriate version of Rtools
before proceeding:



https://cran.rstudio.com/bin/windows/Rtools/

Installiere Paket nach ?C:/Users/Sibylle
St?ckli/AppData/Local/R/win-library/4.2?

(da ?lib? nicht spezifiziert)

trying URL
'https://cran.rstudio.com/bin/windows/contrib/4.2/ggplot2_3.3.6.zip'

Content type 'application/zip' length 4122980 bytes (3.9 MB)

downloaded 3.9 MB



Paket ?ggplot2? erfolgreich ausgepackt und MD5 Summen abgeglichen



Die heruntergeladenen Bin?rpakete sind in 

                C:\Users\Sibylle
St?ckli\AppData\Local\Temp\RtmpcBknba\downloaded_packages

Error in nchar(homeDir) : invalid multibyte string, element 1
#
Can you please provide us with a copy of the error msg? I have used ggplot2 with R 4.2.1, and probably R 4.2.0 in RStudio on Windows 11 and not had trouble. You might need to update R, or RStudio. R and RStudio need to be compatible versions.

Tim

-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of sibylle.stoeckli at gmx.ch
Sent: Monday, October 10, 2022 9:33 AM
To: R-help at r-project.org
Subject: [R] ggplot2 install.package

[External Email]

Dear R members



I am working with RStudio R 4.2.0 and using ggplot2 and gridExtra.

Since some windows updates I get some error when loading  ggplot2.

*       It seems that I am able to install ggplot2. The problem is when
loading ggplot2 with library().
*       Do you have any ideas to solve the problem?





Kind regards

Sibylle



****************************************************************************
******************************

install.packages("ggplot2", dependencies = TRUE)

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:



https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcran.rstudio.com%2Fbin%2Fwindows%2FRtools%2F&amp;data=05%7C01%7Ctebert%40ufl.edu%7C05f8820150e648d4f29108daab015484%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638010323276937614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&amp;sdata=PKqDjS%2FEfL4Mtho3TRywJUuy%2FpGQ9A3seBjgGr6IScM%3D&amp;reserved=0

Installiere Paket nach  C:/Users/Sibylle St ckli/AppData/Local/R/win-library/4.2 

(da  lib  nicht spezifiziert)

trying URL
'https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcran.rstudio.com%2Fbin%2Fwindows%2Fcontrib%2F4.2%2Fggplot2_3.3.6.zip&amp;data=05%7C01%7Ctebert%40ufl.edu%7C05f8820150e648d4f29108daab015484%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638010323276937614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&amp;sdata=b5dcFImQLYrE850p5SnbOyibj9KV0JrZIvfL8trNI84%3D&amp;reserved=0'

Content type 'application/zip' length 4122980 bytes (3.9 MB)

downloaded 3.9 MB



Paket  ggplot2  erfolgreich ausgepackt und MD5 Summen abgeglichen



Die heruntergeladenen Bin rpakete sind in

                C:\Users\Sibylle
St ckli\AppData\Local\Temp\RtmpcBknba\downloaded_packages

Error in nchar(homeDir) : invalid multibyte string, element 1
#
Dear R users

Thanks a lot. I will try again. The error code was below the email, but there was some encryption:
- Error in nchar(homeDir:invalid multibyte string, element 1
- I realised that I was able to install ggplot2, but the error is afterwards when loading ggplot2 (library()). 

Kind regards
Sibylle

install.packages("ggplot2", dependencies = TRUE)
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

Installiere Paket nach ?C:/Users/Sibylle St?ckli/AppData/Local/R/win-library/4.2?
(da ?lib? nicht spezifiziert)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/ggplot2_3.3.6.zip'
Content type 'application/zip' length 4122980 bytes (3.9 MB)
downloaded 3.9 MB

Paket ?ggplot2? erfolgreich ausgepackt und MD5 Summen abgeglichen

Die heruntergeladenen Bin?rpakete sind in 
                C:\Users\Sibylle St?ckli\AppData\Local\Temp\RtmpcBknba\downloaded_packages
Error in nchar(homeDir) : invalid multibyte string, element 1

-----Urspr?ngliche Nachricht-----
Von: Ebert,Timothy Aaron <tebert at ufl.edu> 
Gesendet: Dienstag, 11. Oktober 2022 02:42
An: sibylle.stoeckli at gmx.ch; R-help at r-project.org
Betreff: RE: [R] ggplot2 install.package

Can you please provide us with a copy of the error msg? I have used ggplot2 with R 4.2.1, and probably R 4.2.0 in RStudio on Windows 11 and not had trouble. You might need to update R, or RStudio. R and RStudio need to be compatible versions.

Tim

-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of sibylle.stoeckli at gmx.ch
Sent: Monday, October 10, 2022 9:33 AM
To: R-help at r-project.org
Subject: [R] ggplot2 install.package

[External Email]

Dear R members



I am working with RStudio R 4.2.0 and using ggplot2 and gridExtra.

Since some windows updates I get some error when loading  ggplot2.

*       It seems that I am able to install ggplot2. The problem is when
loading ggplot2 with library().
*       Do you have any ideas to solve the problem?





Kind regards

Sibylle



****************************************************************************
******************************

install.packages("ggplot2", dependencies = TRUE)

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:



https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcran.rstudio.com%2Fbin%2Fwindows%2FRtools%2F&amp;data=05%7C01%7Ctebert%40ufl.edu%7C05f8820150e648d4f29108daab015484%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638010323276937614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&amp;sdata=PKqDjS%2FEfL4Mtho3TRywJUuy%2FpGQ9A3seBjgGr6IScM%3D&amp;reserved=0

Installiere Paket nach  C:/Users/Sibylle St ckli/AppData/Local/R/win-library/4.2 

(da  lib  nicht spezifiziert)

trying URL
'https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcran.rstudio.com%2Fbin%2Fwindows%2Fcontrib%2F4.2%2Fggplot2_3.3.6.zip&amp;data=05%7C01%7Ctebert%40ufl.edu%7C05f8820150e648d4f29108daab015484%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638010323276937614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&amp;sdata=b5dcFImQLYrE850p5SnbOyibj9KV0JrZIvfL8trNI84%3D&amp;reserved=0'

Content type 'application/zip' length 4122980 bytes (3.9 MB)

downloaded 3.9 MB



Paket  ggplot2  erfolgreich ausgepackt und MD5 Summen abgeglichen



Die heruntergeladenen Bin rpakete sind in

                C:\Users\Sibylle
St ckli\AppData\Local\Temp\RtmpcBknba\downloaded_packages

Error in nchar(homeDir) : invalid multibyte string, element 1
#
From long and unhappy experience, I routinely reboot before reporting 
problems like this, then upgrade all software where feasible ... 
including "update.packages".  Some problems magically disappear after 
doing this.


	  If they persist, then, as it says at the end of each email on this 
thread, "PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html and provide commented, 
minimal, self-contained, reproducible code."  If you do that, it 
increases the chances that the help you get will actually be helpful ;-)


	  Spencer
On 10/11/22 1:01 AM, sibylle.stoeckli at gmx.ch wrote:
#
On Mon, 10 Oct 2022 15:32:33 +0200
<sibylle.stoeckli at gmx.ch> wrote:

            
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()?