4

Does installing the development version of ggplot2 overwrite the regular version? I need the dev version for a particular package but I don't want to screw up what I have. Can I then uninstall the dev or is it a matter of just reinstalling the regular version, which will then overwrite the dev version. I googled, found nothing. Thanks

Nico Albers
  • 1,556
  • 1
  • 15
  • 32
JuanTamad
  • 65
  • 9
  • An option would be to use a Docker/Rocker container. https://github.com/rocker-org/rocker Or, you could try packrat which isolates your project package installations. http://rstudio.github.io/packrat/ – Roman Luštrik Feb 24 '18 at 13:33
  • Hey @JuanTamad I consider my answer solved your problem. If it does, consider accepting it via checking the checktick under the vote buttons. Otherwise, feel free to ask for more details ;-) – Nico Albers Mar 03 '18 at 21:05

1 Answers1

5

according to this answer, it doesn't overwrite when using devtools sandbox:

install.packages("devtools")
library(devtools)
dev_mode(on=T)
install_github("hadley/ggplot2")
# use dev ggplot2 now
# when finished do:
dev_mode(on=F)  #and you are back to having stable ggplot2

For more information on the dev_mode (like specifying the sandbox where R saves the dev package in), have a look at the devtools documentation

Nico Albers
  • 1,556
  • 1
  • 15
  • 32
  • 1
    Also see the switchr package for switching R libraries. – G. Grothendieck Feb 24 '18 at 14:19
  • Thanks, that is nice, too! Documentation is [here](https://cran.r-project.org/web/packages/switchr/switchr.pdf), see `install_package` section for information on how to use with github. Of course there are other packages doing this, too, see the other answers on the linked thread for more ideas on how to solve this, I gave only one approach. – Nico Albers Feb 24 '18 at 14:23