knitr::opts_chunk$set( comment = "##", tidy = FALSE, error = FALSE, fig.width = 8, fig.height = 8)
Proof of concept, to load multiple versions of the same R package at once.
We install two versions of the same package, in temporary directories. Temporary directories first.
library(camo) library(magrittr) tmp1 <- tempfile() tmp2 <- tempfile() dir.create(tmp1) dir.create(tmp2)
Install the first version into tmp1
.
.libPaths(tmp1) install.packages("DBI", type = "source")
Install the second version into tmp2
.
.libPaths(tmp2) install.packages("http://cran.rstudio.com/src/contrib/Archive/DBI/DBI_0.2-7.tar.gz", repos=NULL, type="source")
Now add both temporary directories to the search path, and see what versions we have.
.libPaths(c(tmp1, tmp2)) package_versions("DBI")
Load both versions.
camo("DBI", "0.2-7") camo("DBI", "0.3.0") loadedNamespaces() %>% grep(pattern = "^DBI", value = TRUE)
See the functions in both versions.
ls(asNamespace("DBI@0.3.0")) ls(asNamespace("DBI@0.2-7"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.