Installing lixoftConnectors R package


Introduction

lixoftConnectors is an R package that provides functions to run Monolix. It comes bundled with each Monolix installation. On Metworx, Monolix installations are under /opt/monolix/, and each lixoftConnectors package is at /opt/monolix/{monolix_version}/connectors/lixoftConnectors.tar.gz.

Metworx 22.09, for example, has MonolixSuite2020R1 and MonolixSuite2021R1 installations, and each has a tarball for the lixoftConnectors package:

$ find /opt/monolix -name lixoftConnectors.tar.gz
/opt/monolix/MonolixSuite2020R1/connectors/lixoftConnectors.tar.gz
/opt/monolix/MonolixSuite2021R1/connectors/lixoftConnectors.tar.gz

Installing lixoftConnectors

Calling install.packages() with the bundled tarball is the officially recommended method of installing lixoftConnectors.

If you're working in an environment with the default R libraries, you can simply call install.packages() with the tarball path to install lixoftConnectors to the R library in your home directory:

install.packages("/opt/monolix/MonolixSuite2021R1/connectors/lixoftConnectors.tar.gz", repos = NULL)

On the other hand, if you are using renv to create an isolated environment, an extra step is needed to install lixoftConnectors dependencies:

install.packages(c("RJSONIO", "ggplot2", "gridExtra"))
install.packages("/opt/monolix/MonolixSuite2021R1/connectors/lixoftConnectors.tar.gz", repos = NULL)

Installing with pkgr

For projects using the approach described at Set up pkgr, MPN and renv, you can instruct pkgr to install lixoftConnectors from the bundled tarball. For example, the following pkgr.yml installs the lixoftConnectors package bundled with MonolixSuite2021R1 into a project's renv library:

Version: 1
Packages:
  - RJSONIO
  # ... other packages used by the project ...
Repos:
  - MPN: https://mpn.metworx.com/snapshots/stable/2023-12-05
Tarballs:
  - /opt/monolix/MonolixSuite2021R1/connectors/lixoftConnectors.tar.gz
Lockfile:
    Type: renv

The key parts are pointing to the bundled lixoftConnectors with a Tarballs entry and adding its RJSONIO dependency to the list of packages.