Problems installing new packages

Hello. I am new to R and I am trying to install ggplot2, dev tools. This is the R version I am running:

> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils    
[5] datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.1.2 cli_3.1.1     
[3] tools_4.1.2   
> install.packages("ggplot2", "devtools")
Warning in install.packages :
  'lib = "devtools"' is not writable
Would you like to use a personal library instead? (yes/No/cancel) no
Error in install.packages : unable to install packages

Here is the error I receive when I try to install ggplot2 on its own:

trying URL ''
Content type 'application/x-gzip' length 4125542 bytes (3.9 MB)
downloaded 3.9 MB

The downloaded binary packages are in

What am I missing? Any help is appreciated.


That's probably the most important part. Please allow (by typing yes) to install to local/personal library.


This error is happening because when you want to install more than one package at once you need to pass them as a list, not as individual elements. So the command should be :

install.packages(c("ggplot2", "devtools"))

You are not showing any error messages, those are normal installation messages.

Okay I'll type in yes.

Thank you I was unaware that list commands were different.

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.