If you barrel ahead and install your peer’s gameday
package for review, it will likely overwrite the installation of your own gameday
package. Note: only your installed package is at risk. The source of your gameday
package lives on safely on your computer and on GitHub. And you could re-install from either source.
If you want to be more careful, here are two approaches to take more control of the situation.
In this option we install the peer’s version of gameday
to a non-default library, leaving the installation of our own version intact.
First, restart your R session. Specifically, we don’t want your gameday
package to be loaded before we start this. To confirm this is true, enter search()
and make sure you don’t see gameday
listed in the result.
This is nothing more than creating a new directory on your computer. It’s where you’ll install and load your peer’s package from. Then we’ll delete it. I’m putting in my all purpose temp directory, but you can pick another location.
tmp_lib <- "~/tmp/tmp_lib"
dir.create(tmp_lib)
Navigate to this directory in some file browser and confirm the directory exists.
gameday
from your peerInstall your peer’s gameday
package from GitHub into your temporary library. Below, devtools::with_lib()
prepends your usual list of libraries with tmp_lib
. Load your peer’s package from there and confirm you’re using the right version via maintainer()
.
library(devtools)
with_lib(tmp_lib, install_github("rebjoh/gameday"))
library(gameday, lib.loc = tmp_lib)
maintainer("gameday")
Use the peer’s package and submit your review.
Delete your temporary library any way you want. Restart your R session to clean out your loaded packages and rest assured that plain ol’ library(gameday)
will now load your version. Use maintainer()
to check if you are worried. Here’s an R command to get rid of the temporary library.
unlink(tmp_lib, recursive = TRUE)
In this option we temporarily overwrite our installed version of gameday
with the version of our peer. This means that during the peer review we will not be able to load and run our version of gameday
.
Let’s make extra sure your gameday
source package is safely stored locally and on GitHub.
gameday
package.De-install gameday
and confirm it’s truly gone from your library:
remove.packages("gameday")
## Restart R session
library("gameday")
## Error in library("gameday") : there is no package called ‘gameday’
gameday
and confirm it’s back in your library. Use RStudio’s “Build & Reload” then call gday()
, get help ?gameday
, browse the vignette, etc.gameday
again (see above).Re-install gameday
from GitHub this time.
library(devtools)
install_github("YOURGITHUBUSERNAME/gameday")
library("gameday")
Revisit spot checks from above that gameday
is back and in working order.
If everything works as expected, you can feel good that your package source is safely stored locally and on GitHub.
gameday
from your peerNow that you know that you can re-install your version of gameday
, it’s time to let your peer’s version of gameday
take over.
Install your peer’s gameday
, load it, check maintainer:
devtools::install_github(YOURPEER/gameday)
library(gameday)
maintainer("gameday")
## USE IT
Review peer’s version of gameday
.
Once you are done with the peer review, restore your own version of gameday
.
gameday
Project and do “Build and Reload”.Or install from GitHub
devtools::install_github("YOURGITHUBUSERNAME/gameday")
Either way, verify your version is now installed:
maintainer("gameday")