R packages installation

#1

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

0 Likes

#2

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:

0 Likes