Change permissions in the default library. Try .libPaths()
to see folders where R saves packages by default. I'm using Arch Linux, and in my case it's:
> .libPaths()
[1] "/usr/lib/R/library"
But if you're running Ubuntu, you're probably going to get several folders. However, you need to run from terminal:
sudo chmod -R a+rw /usr/lib/R/library/
or from R:
system("sudo chmod -R a+rw /usr/lib/R/library/")
...for each folder, or you can do (from R):
for (i in 1:length(.libPaths())) {
system(paste("sudo chmod -R a+rw", .libPaths()[i]))
}
...and change them all with one blow.
- more info on shell command:
chmod
changes permissions of the files/folders, -R
is for recursion, a+rw
means: a ll can r ead + w rite, and then you point to the file/folder.