In the following the pre-required software and the workflow for installing the R package aquanes.report is described.

Pre-required software

  • R (>= 3.3.2): for the development of the R package aquanes.report R 3.3.2 was used. However, also later R releases (e.g. 3.4) should be working.

  • Rtools: required to compile R packages from source (Attention: the required version depends on the installed R version on your OS)

  • Pandoc: is required to convert the reports from plain text format (markdown) into the different formats (docx, html, pdf).

  • Miktex: needs to be installed in case that pdf reports should be created.

For the advanced user it is further recommended to install the latest version of the integrated development environment (IDE) RStudio Desktop “open source licence”.

R package installation

Once all pre-required software is installed on your operating system you can proceed with the R package installation workflow as described below.

Step 1) Installation of R package “devtools”

The R package “devtools” is required for downloading and installing the R package “aquanes.report” from Github. For installing it execute the following lines of code in R(Studio):

if (!require("devtools")) {
  install.packages("devtools", repos = "https://cloud.r-project.org")
}

Step 2) Installation of R package “aquanes.report”

2.1) Specific release

In case you want to install a specific release you need to specify the parameter “ref”, which needs to be set to a valid release (check here: releases) by running the following code in R(Studio). This tutorial at least requires release version v.0.4.0):

devtools::install_github("kwb-r/aquanes.report", 
                         ref = "v.0.4.0",
                         dependencies = TRUE)

Please cite v.0.4.0 of the R package as follows: DOI

2.2) Development version

If you want to install the latest (possibly unstable!) development version, execute the following lines of code in R(Studio):

devtools::install_github("kwb-r/aquanes.report", 
                         dependencies = TRUE)

Step 3) Check the installation folder of the package in R(Studio) with:

system.file(package = "aquanes.report")

Step 4) Two files need to be copied:

4.1) mySQL configuration file (‘.my.cnf’)

The ‘.my.cnf’ file is required to establish a connection to the mySQL database for querying the operational data for the Haridwar site. It needs to be copied into the following directory:

system.file("shiny/haridwar", package = "aquanes.report")

4.2) Analytics spreadsheet file (‘analytics.xlsx’)

The ‘analytics.xlsx’ file contains the analytics data for the Haridwar site and needs to be copied into the following directory:

system.file("shiny/haridwar/data", package = "aquanes.report")