0

if (!require(install.load)){
install.packages("install.load")
}

install.load::install_load(packages) 

This is the current script, I would like to now include the versions of each of the packages. Let me know if you have any ideas!

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 1
    There's nothing in that package that suggests it knows anything about package versions, nor in how to manage a local R library of packages that is version-specific. If you want to maintain specific versions (similar to python's `requirements.txt`), then look into the `renv` or `packrat` packages. BTW: if you're already doing `!require("install.load")`, why don't you just do the same for the rest of your packages? – r2evans Mar 05 '21 at 16:38
  • I have come to realize, that i need to work with those specific versions and thus, I need to mention the versions. My aim was that if I am able to make it easier for other user to also run, the script with similar versions. – Nikhil Kakdiya Mar 05 '21 at 16:43
  • I understand. Use `renv` or `packrat`. Neither base R (`install.packages`) nor the `install.load` package supports your use-case, whereas both of `renv` and `packrat` were *designed* for that use-case. – r2evans Mar 05 '21 at 16:45

0 Answers0