Chapter 2 Getting Started

2.1 Required Software

To get started with the DLMtool you will need at least two things:

  1. A current version of the R software installed on your machine.
  2. The latest version of the DLMtool package.

2.1.1 The R Software

The R software can be freely downloaded from the CRAN website and is available for all operating systems. Updated versions of R are released frequently, and it is recommended that you have the latest version installed.

If you are using Windows OS, you can uses the installr package and the updateR() function to update and install the latest version. Alternatively, head to the CRAN website to download the latest version of R.

You can check your version of R by typing version into the R console:

##                _                           
## platform       x86_64-w64-mingw32          
## arch           x86_64                      
## os             mingw32                     
## system         x86_64, mingw32             
## status                                     
## major          3                           
## minor          6.2                         
## year           2019                        
## month          12                          
## day            12                          
## svn rev        77560                       
## language       R                           
## version.string R version 3.6.2 (2019-12-12)
## nickname       Dark and Stormy Night

2.1.2 RStudio

RStudio is a freely available integrated development environment (IDE) for R. It is not essential that you use RStudio, but it can make things a lot easier, especially if you are new to R. This User Guide assumes that you are using RStudio to operate the DLMtool.

It is important to be aware that RStudio and R are two different pieces of software that must be installed separately. We recommend installing the R software before downloading and installing RStudio.

2.2 Installing DLMtool

If this is the first time you are using DLMtool, you will need to install the DLMtool package from CRAN.

2.2.1 Installing DLMtool using R Console

This can be done by running the command:


A prompt may appear asking you to select a CRAN mirror. It is best to pick the mirror that is the closest geographical distance.

2.2.2 Installing DLMtool in RStudio

An alternative method to install the DLMtool package is to click the Packages tab in the lower right panel in RStudio, and click Install. Check that Repository (CRAN, CRANextra) is selected in the Install from: drop-down menu, type DLMtool into the packages dialog box, and click Install.

The DLMtool package relies on a number of other R packages, which the installation process will automatically install. The number of packages that are installed, and the time it takes, will depend on what packages you already have installed on your system (and your download speed).

2.2.3 Updating the DLMtool Package

You will only need to install the DLMtool package once. However, the DLMtool package is updated from time to time, and you will need to re-install from CRAN for each new version.

This can be done by using the update.packages command:


2.2.4 Checking DLMtool version

You can confirm the version of DLMtool by typing:

## [1] '5.4.2'

2.3 Loading DLMtool

Once installed, the DLMtool package can be loaded into R by typing in the command line:


or locating the DLMtool package in the list of packages in RStudio and checking the box.

You need to load the DLMtool package each time you start a new instance of R.