This guide navigates through some quirks and considerations during
the installation of the rosace
and cmdstanr
packages, particularly those related to compiler configurations on
different operating systems. While installations on the latest MacOS and
Linux with Ubuntu have been smooth, we’ve noted a few issues for
installing on the Linux CentOS distribution related to C++
configurations. Alternatively, you may want to use a Docker container
with the image we provided to bypass those issues.
cmdstanr
Before installing rosace
, you will need to install
cmdstanr
first using the code below.
install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
# Use cmdstanr to install CmdStan, this requires a working C++ toolchain and compiler
library(cmdstanr)
install_cmdstan(cores = 2)
# Check that installation is successful by checking the CmdStan version
cmdstan_version()
If you are downloading on a Linux platform and encounter errors, it
is likely due to requirements for a C++ complier since stan
is built in C++. According to stan-dev,
stan
is tested on Linux with g++ 5 (a compiler for C++).
Ensure that your system is equipped with a gcc version > 5 which
includes g++. You can check the current version in the terminal
using:
If gcc is not installed or if your version is below the required, you’ll need to install or upgrade it, following guidelines specific to your Linux distribution. You may check the distribution information in the terminal using:
impute
If you encounter
xx is not available for this version of R
, or
xx is not available for rosace
during the automatic
installation, you may try download it manually. For example, the package
impute
is not available on CRAN and can be downloaded using
the following:
If you prefer to use a Docker container to run the analysis, we’ve
provided a Docker image for rosace
. Please follow the instructions to install
Docker on your system. Once Docker is installed, you can pull the rosace
Docker image with the following command:
To run the Docker container and access its shell environment, use a command similar to the following, which creates a container and enters an interactive shell environment
docker run --rm --platform linux/amd64 -it --entrypoint bash --name rosacecontainer roseraosh/rosace
You may also add an argument to mount your local directories or data
files to the container. Replace /PATH/TO/DATADIR
with the
actual path to your data directory on your local system:
docker run --rm --platform linux/amd64 -it -v /PATH/TO/DATADIR:/home/rosace/data --entrypoint bash --name rosacecontainer roseraosh/rosace
Once you are in the container, you may invoke R with:
And start the analysis by loading the rosace
package: