COMPASS-DOE / rs-synthesis

0 stars 0 forks source link

In general scripts shouldn't install packages #63

Closed bpbond closed 2 years ago

bpbond commented 2 years ago

This

packageurl <- "http://cran.r-project.org/src/contrib/Archive/MuMIn/MuMIn_1.43.15.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

isn't great practice. First, it's going to re-install the package every time the Rmarkdown is knit, which isn't needed. And second, it's bad form (imho) to install a package on someone's system like this; let them do it themselves.

kendalynnm commented 2 years ago

That makes sense. This was my attempt to force the script to run an old version of that package. Let's discuss better strategies tomorrow.

kendalynnm commented 2 years ago
if(packageVersion("MuMIn") > "1.43.15") {
 stop("This analysis won't work with newer versions of MuMIn; please install 1.43.15")
}