0

I am trying to follow along with the online data viz resource by Kieran Healy (socviz.co), and have had minimal trouble setting things up to do so. I cannot seem to successfully install his 'socviz' package. This is the code Healy suggests:

devtools::install_github('kjhealy/socviz')

This returns:

ERROR: dependency 'rlang' is not available for package 'socviz'
* removing 'C:/Users/annem/OneDrive/Documents/R/win-library/3.4/socviz'
Installation failed: Command failed (1)

I tried removing and reinstalling 'rlang', but I still received the same error. I have also tried restarting R.

When reinstalling 'rlang', I get the following:

package ‘rlang’ successfully unpacked and MD5 sums checked
    Warning in install.packages :
    cannot remove prior installation of package ‘rlang’

And when trying to load:

library(rlang)
    Error in library(rlang) : there is no package called ‘rlang’

I'm using R v 3.4.2 on Windows 10.

I'm relatively new to R, so if there's a seemingly obvious solution (or you think it could be solved by doing something I've already done) let me know!

It's very possible I'm making a silly mistake, but I haven't found it myself. Any help is appreciated!

  • 1
    What messages do you get when you reinstall `rlang`? Can you load it properly with `library(rlang)`? – MrFlick May 03 '18 at 17:52
  • I did a little more googling, and found that this "cannot remove prior installation of package 'xxxx'" warning is pretty common and can be solved by deleting the old files. I went ahead and deleted the dependency packages from my machine--and voila! 'socviz' is installed successfully. Is remove.packages() not the same as deleting them? – Annie Brown May 03 '18 at 18:40
  • The reason you couldn't delete `rlang` with `remove.packages` because it was loaded in your R session. Need to restart R and start from a clean session to remove it – Tung May 03 '18 at 18:57

1 Answers1

1

Turns out the problem was in how I was removing 'rlang'. I was attempting to using remove.packages() while the package was loaded into my session. I deleted it from my machine directly, but as Tung mentioned, using the remove.packages() command works as long as it is not loaded into the current R session.

Lesson learned--thanks!