Installing package in older version of R (without updating)

I am developing a shiny package in R version 4.1.3 and want to check that it is backwards compatible for R version >= 3.5.0. To this end I have switched in RStudio to using R 3.5.0 but I am having trouble installing the required packages. When installing e.g. shiny while using 3.5.0, I get asked 'Do you want to install from sources the packages which need compilation?' followed by 'Do you want to attempt to install these from sources?'. From Meaning of common message when install a package "There are binary versions available but the source versions are later" I understand that answering No here is what I need. This is followed by R installing many dependencies but some give the error : dependencies 'namepackage1' are not available for package 'namepackage2'. How do I install the packages properly in the older version of R?

Why do you think that? If you are not setting specific package versions R is always going to try to install the latest available version and by doing this you might brake some package dependencies. If the "shiny package" (I assume it is a shiny app wrapped as an R package?) is meant to be installed by others in their own environments then I think you should assume they are going to update their packages so you should be installing the latest package versions as well, ergo, you need to compile form source. Ultimately, your package dependencies are going to dictate what your minimal R version is going to be, R 3.5 might not be possible with your current package dependencies.

Another way to go about this is to use renv to manage your package versions or if you need even more reproducibility, distribute your package as a container that others can run.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.