Can not download 'ggplot2'

Hi everyone,

I tried several way to install ggplot2 on R in Mac system, and I have download the package as it suggested, but still failed to install it. I am a beginner in R, so I have no idea how to solve it as I have read so many articles. Please give me suggestions, thank you!

knitr::opts_chunk$set(echo = TRUE)
install.packages('ggplot2')
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.1/ggplot2_3.3.5.tgz'
Content type 'application/x-gzip' length 4125542 bytes (3.9 MB)
==================================================
downloaded 3.9 MB

The downloaded binary packages are in
/var/folders/jt/bc6lcv8538nby_j6076xx9km0000gn/T//RtmpNppkLK/downloaded_packages

Hi, that doesn't show an error.

What happens when you run library(ggplot2)?

1 Like

Hi Williaml:

The message shows out like below.

Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘colorspace’

Try installing that pacakge: install.packages("colorspace"). Better yet, just install the tidyverse: install.packages("tidyverse").

1 Like

It works when I install. Thank you so much. This really helps me :grinning_face_with_smiling_eyes:

1 Like

This topic was automatically closed 7 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.