Using tsdrtools

library(tsdrtools)

The goal of tsdrtools is to make it easier for R users of TSD to install packages that fail install using the TSD mini-CRAN. Certain R-packages require compilation outside of TSD before they can be installed, and as such can be burdensome for some users to administer.

Since packages often have a myriad of dependencies, this process can becomes increasingly cumbersome, as all these extra packages also need to be obtained, which again might require special compilation.

In the two step procedure here, a package is downloaded together with all dependent packages, zipped into an archive for easy import into TSD, where it can be unzipped and installed using a special function.

Installation

You can install the development version of tsdrtools

install.packages("remotes")
remotes::install_github("LCBC-UIO/tsdrtools")

for installation of this package inside TSD, download the newest source file from https://github.com/LCBC-UiO/tsdrtools/.

Transfer the package to TSD (import it), and install as a source package.

install.packages("/path/to/tsdrtools.tar.gz", repo = NULL)

Examples

This package contains two main functions:

  1. tsd_package_prepare() is used outside of TSD, with internet connection to prepare a package for install within TSD.
  2. Once step 1 is completed and data transfered to TSD, the tsd_package_install() is used within TSD to install the package within TSD.
library(tsdrtools)

# outside TSD
tsd_package_prepare("dplyr")

# within TSD
status <- tsd_package_prepare("dplyr.zip")

By saving the output of tsd_package_prepare you can scope the potential error messages from the install after they have occurred. Failed installs may happen not only because we have yet to discover some issue with certain packages, but also because there might be OS dependencies that a package needs to work, which might not be installed on your TSD VM. In such cases, having the error and showing it to IT would help them get the necessary OS libraries installed for you.

# View install status
status
#> # Offline installation status
#> 
#> # Installation succeeded for 1 packages: cli
#> # Installation *failed* for 1 packages: NA

error_logs(status)
#> #### crayon
#> The full build error
#> will appear here.
#> This is just a mock example

Limitations

Currently the package will only prepare and install packages that are available on CRAN. We are working on a version that might allow downloading and making available packages from other repositories, and welcome any contribution that will help us achieve this.