2

So the thing is my IT department is scared of R and therefore only allows us to use it on a laptop that can't go online. Therefore they are the ones to install packages on it.

But due to covid I'm at home discovering they didn't install the requested packages. So I'm looking to see if there is a way to download these packages on a laptop with internet access, add them to an USB and then install them from the USB in R?

Louise Sørensen
  • 225
  • 1
  • 11
  • https://stackoverflow.com/a/28885499/1412059 – Roland Mar 05 '21 at 09:16
  • The details depend on your (unstated) operating system, but you can download packages from [CRAN](https://cran.r-project.org/) and then install from the downloaded file – Miff Mar 05 '21 at 09:16
  • I don't understand your IT departments rationale. R might be scary because of what you as a user can do with it but not because it makes the system particularly vulnerable to outside attacks. If they find it so scary, they shouldn't allow it at all (but that means they shouldn't allow most of the software you are using). – Roland Mar 05 '21 at 09:20
  • @Roland Yes I agree. This is ridiculous. I hope they'll change their minds soon. I'm pretty new at this organization so this was a big shock for me. – Louise Sørensen Mar 05 '21 at 09:22
  • @Miff thanks a lot, will give it a try! – Louise Sørensen Mar 05 '21 at 09:22

1 Answers1

1

Quite easy, just download the package from the CRAN site e.g. https://cran.r-project.org/web/packages/imputeTS/

You can either download the "Package source" or the "Binaries" (must be your operating system.

If you are using R Studio, there is then even a menu item for installing the package - just select the file you downloaded and here you go. enter image description here

If you are not using R Studio, just provide the path to your downloaded archive in the install.packages command.

The only problem is, you also need all the dependencies ...;) So you ideally already have them and just one package is somehow missing - otherwise this can get quite time consuming to download all the dependencies - because the dependencies itself also usually have dependencies themselves...

In this case the miniCRAN solution Roland linked in the comments might be an idea. ( Offline installation of a list of packages: getting dependencies in order ) But didn't try the miniCRAN myself yet - would be interested how good this actually works.

Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55