swirldev / swirl

:cyclone: Learn R, in R.
http://swirlstats.com
Other
1.14k stars 601 forks source link

install swirl #845

Open MariaEfthimiadou opened 3 years ago

MariaEfthimiadou commented 3 years ago

install.packages("swirl") Warning in install.packages : 'lib = "C:/Program Files/R/R-3.6.1/library"' is not writable Error in install.packages : unable to install packages

thats the message that i take when i try to install this packages,can you help me ? what can i do so i can install it?

dsr54 commented 3 years ago

Me too! image

mitushiananya commented 3 years ago

There are two ways in which you can overcome this:

First Way: install.packages(“swirl”)

Installing package into ‘C:/Program Files/R/R-3.6.1/library’ (as ‘lib’ is unspecified) Warning in install.packages("swirl"): 'lib = “C:/Program Files/R/R-3.6.1/library”' is not writable

Would you like to use a personal library instead?  (y/n) y

Would you like to create a personal library ~/R/…… to install packages into?  (y/n) y

So, during the installation answer both questions with 'y'. And this will install the package without any issues.

Second Way:

You can add yourself to the group called 'staff'

sudo usermod -a -G staff username

Replace username with your login username, then logoff and again login.

JaccapowerG commented 3 years ago

I had the same error of dsr54

library(swirl) Errore: package or namespace load failed for ‘swirl’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘rlang’ Even if I try to install rlang and I'm not able to have the way of mitushiananya to work ... how can I do? thanks

mitushiananya commented 3 years ago

I had the same error of dsr54

library(swirl) Errore: package or namespace load failed for ‘swirl’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘rlang’ Even if I try to install rlang and I'm not able to have the way of mitushiananya to work ... how can I do? thanks

This error usually comes when you don't install all the dependencies. To avoid this install the package with all its dependencies. Let me know if even after this you get the same error.

install.packages("swirl", dependencies=TRUE) library(swirl)