The installation is in two steps:
First carry out the instructions below for your OS
Then install the package in R.
1) Install compilers for your OS
It’s best to install the latest version of R (download
Next you must install a set of compilers required for ctsmr to work: Download the version for your R version (Rtools
) and install it. Please follow the instructions and remember the step to put Rtools on the PATH.
For 3.x versions, you mostly you do not have to change any settings during the installation of Rtools (however in few rare cases it has been necessary to “add rtools to system PATH” see this here
macOS (OS X 10.11 or higher):
Compilers must be installed after installing R, so:
- For R 3.x (tested on mac with R 3.5.1):
You may have to tell R where to find the newly installed compilers. This is done through a text file “Makevars”. In a Terminal run:
# Create a folder .R in the user folder.
# Download Makevars
Use any newer version of R and make sure to install gcc and gfortran through the package manager of your OS.
2) Install the ctsmr R package
Open R using e.g. Rstudio. In the Console run:
# Create a folder .R in the user folder
install.packages("ctsmr", repos = c(ctsmr = "http://ctsm.info/repo/dev", getOption("repos")))
In case you get the warning: “Package is only available in source form…”) then answer “Yes” to the question about installing from source. To avoid this warning and always install from source use:
install.packages("ctsmr", repos = c(ctsmr = "http://ctsm.info/repo/dev", getOption("repos")), type="source")
ctsmr is now ready for continous time stochastic modelling.