Error installing ggplot2 in MacOX Mojave using R version 4.0.0

I just downloaded R and RStudio for Mac (R version 4.0.0 for my MacOC Mojave version 14.3.6) and I was trying to install a couple of common packages such as ggplot2 and I got this message:

install.packages("ggplot2")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/ggplot2_3.3.0.tgz'
Content type 'application/x-gzip' length 4012531 bytes (3.8 MB)

downloaded 3.8 MB

The downloaded binary packages are in
/var/folders/7d/3bmswxz51rn7nbt7317nj8xh0000gn/T//Rtmpw6EcZk/downloaded_packages

But then when I tried to use the function ggplot, it gave me this message:

Error in ggplot(data = mydata, aes(x = carat, y = price)) :
could not find function "ggplot"

How can I remedy this issue?

You need to load the package first:

library(ggplot2)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.