R packages installation

I am new to R and I do not know how to set a working directory to download r packages. I am creating a folder in C drive and writing
install.packages("ggplot2", lib="//Users//Rahul//Desktop//R//download packages")

Warning in install.packages("ggplot2", lib = "//Users//Rahul//Desktop//R//download packages") :
'lib = "//Users//Rahul//Desktop//R//download packages"' is not writable
Error in install.packages("ggplot2", lib = "//Users//Rahul//Desktop//R//download packages") :
unable to install packages

This is a file permissions issue. Your system needs write-access to the directory in order to put packages into it.

If you're on a mac, you might take a look at this:

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