Error message when trying to install ggplot2

Hello,

I am a new R user. I am currently trying to install ggplot 2 package on my mac (macOS Mojave).

I am running the following command:

install.packages("/Volumes/One-Drive/OneDrive - University of Brighton/Second year files/BY260 - Research skills and professional development/Stats/R stat/Packages/ggplot2")

Prompted with:--- Please select a CRAN mirror for use in this session ---
Select London,UK

Then I get the following warning:
ackage ‘/Volumes/One-Drive/OneDrive - University of Brighton/Second year files/BY260 - Research skills and professional development/Stats/R stat/Packages/ggplot2’ is not available (for R version 3.5.2)

Am I reading this message wrongly?

Does the location of the package matter in my machine? I currently save the packages on my OneDrive volume. I've had a problem with other softwares, where they can't open files from my OneDrive volumes then having to move them to my actual volume to open.

Does the file path matter in the command line? Do I need to put the package in the work directory then only add the name to the command line?

Do I need to download an older version of R to use the package? I downloaded the up to date files from CRAN, so not quite sure about it.

I would really appreciate your help.

You don’t download packages before installing them — they will be downloaded automatically.

As such, use the following command to install a package:

install.packages('ggplot2')

(There’s also a way to install a already-downloaded packages but it’s more complicated and rarely useful.)

2 Likes

Thanks mate, that was helpful.

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.