Skip to content

Commit

Permalink
Merge pull request #8 from kristinawlai/installation_instructions
Browse files Browse the repository at this point in the history
Installation instructions
  • Loading branch information
d-morrison authored Oct 5, 2023
2 parents d056395 + 8448726 commit 362be20
Show file tree
Hide file tree
Showing 6 changed files with 477 additions and 74 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.Rhistory
.RData
.Ruserdata
.html
inst/doc
/doc/
/Meta/
Expand Down
453 changes: 453 additions & 0 deletions README.html

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ the longitudinal response of the selected serum antibodies.
## Installation

You can install the development version from
[GitHub](https://github.com/) with:
[GitHub](https://github.com/) with the following code:

``` r
install.packages("devtools")
Expand All @@ -30,16 +30,26 @@ devtools::install_github("ucd-serg/serocalculator")

**A Note for Windows Users**

Windows users will need to install Rtools, which contains a collection of tools for building and employing R packages that are still in development.
Windows users will need to install Rtools, which contains a collection of tools for building and employing R packages that are still in development. This can be done either during the *devtools* package installation, or independently if *devtools* is already installed.


| *During devtools installation:*
| When prompted to install additional build tools, select "Yes" and Rtools will be installed. |

!(Click Yes to install Rtools along with the *devtools* package)[\vignettes\fig\Rtools1.png]
|

| *Independently:*

1. Download Rtools from https://cran.r-project.org/bin/windows/Rtools/
2. Run the installer

During the Rtools installation you may see a window asking you to “Select Additional Tasks”.

Do *not* select the box for “Edit the system PATH”. devtools and RStudio should put Rtools on the PATH automatically when it is needed.
Do select the box for “Save version information to registry”. It should be selected by default.

* During the Rtools installation you may see a window asking you to “Select Additional Tasks”.
* Do **not** select the box for “Edit the system PATH”. devtools and RStudio should put Rtools on the PATH automatically when it is needed.
* **Do** select the box for “Save version information to registry”. It should be selected by default.
|
## Getting Help

If you need assistance or encounter a clear bug, please file an issue with a minimal reproducible example on [GitHub](https://github.com/UCD-SERG/serocalculator/issues).
Expand Down
Binary file added vignettes/fig/CrashReports.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/fig/Rtools1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 8 additions & 69 deletions vignettes/installation.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Serocalculator package installation manual"
author: "European Centre for Disease Prevention and Control (ECDC)"
author: "UC Davis Seroepidemiology Research Group (SERG)"
date: "`r Sys.Date()`"
output:
rmarkdown::html_vignette:
Expand All @@ -23,7 +23,7 @@ pkgVersion <- packageDescription(pkgName)$Version
pkgDate <- packageDescription(pkgName)$Date
pkgBaseFileName <- paste(pkgName, pkgVersion, sep = "_")
pkgUrl <- gsub("\n", "", packageDescription(pkgName)$URL)
pkgPath <- "http://ecdc.europa.eu/en/data-tools/seroincidence-calculator-tool/Documents"
pkgPath <- "https://ucd-serg.github.io/serocalculator/"
library("knitr")
```

Expand All @@ -34,13 +34,13 @@ library("knitr")
Package **`r pkgName`** is written in programming language R and end user must have access to a
working installation of R engine. This document describes the most common setup with R installed
locally on the user's computer. The screenshots refer to the classical R interface, but the package
can also be opened in other Graphical User Interfaces fo R like e.g.
can also be opened in other Graphical User Interfaces for R like e.g.
[RStudio](http://www.rstudio.com/products/RStudio/).

# 2. Installation steps

R is a free software and can be downloaded from [http://cran.r-project.org/](http://cran.r-project.org/).
Latest version as of writing this document is **R 3.5.0**. Once the appropriate, operating system
Latest version as of writing this document is **R 4.3.1**. Once the appropriate, operating system
dependent, version is downloaded, install it on your computer following the standard procedure
applicable to the operating system. For Windows the file to be downloaded is the so-called *base*
distribution: [http://cran.r-project.org/bin/windows/base/](http://cran.r-project.org/bin/windows/base/).
Expand Down Expand Up @@ -85,74 +85,13 @@ include_graphics("fig/RGui1.png")

## 2.2. Installing *serocalculator* package

Since this is a new installation of R, the **serocalculator** package must be installed before first
use. The package can be installed either through a menu option in the graphical user interface (GUI)
or with a command executed in the R console. Both options are presented:
Since this is a new installation of R, the **serocalculator** package must be installed before first use. As of 09/20/2023, **serocalculator** is still in development. To install the development version, you must install the **devtools** package and then download **serocalculator** from GitHub.

### 2.2.1. Package installation from the graphical user interface

Download the serocalculator package from ECDC website: [`r pkgUrl`](`r pkgUrl`).
Two versions of the package are made available:

* binary package (serocalculator_[version].zip) - Microsoft Windows compatible
* Source package (serocalculator_[version].tar.gz) - cross-platform compatible (MS Windows, Linux,
MacOS)

If your operating system is Windows then it is best to download the Windows binary package.

Go to menu *Packages* and select command *Install package(s) from local files...*:

```{r echo=FALSE, fig.pos="!h", fig.align='center'}
include_graphics("fig/RGui2.png")
```r
install.packages("devtools")
devtools::install_github("ucd-serg/serocalculator")
```

Select the package file and click "Open":

```{r echo=FALSE, fig.pos="!h", fig.align='center'}
include_graphics("fig/RGui3.png")
```

Post-installation message should appear:

```{r echo=FALSE, fig.pos="!h", fig.align='center'}
include_graphics("fig/RGui4.png")
```

The package is now installed in R.

### 2.2.2. Package installation from R console

Alternatively, installation of the package can also be performed
by executing one of the following commands in the *R console*:
```{r, include=FALSE, tidy=FALSE}
chunkTemplate <- "```{r, eval = FALSE}
# OPTION A
# Install Windows binary package \"serocalculator\" directly from internet ECDC website:
install.packages(
pkgs = \"{{pkgPath}}/
{{pkgBaseFileName}}.zip\",
repos = NULL, type = \"win.binary\")
# OPTION B
# Install source package directly from internet CRAN repository:
install.packages(\"serocalculator\")
# OPTION C
# Install Windows binary package from a local file:
# install.packages(\"[PATH/TO/FILE/]serocalculator_[version].zip\",
# repos = NULL, type = \"win.binary\")
# For instance:
install.packages(pkgs = \"C:/{{pkgBaseFileName}}.zip\", repos = NULL, type = \"win.binary\")
# OPTION D
# Install source package from a local file:
install.packages(pkgs = \"C:/{{pkgBaseFileName}}.tar.gz\", repos = NULL, type = \"source\")
```"
chunkSource <- knit_expand(text = chunkTemplate, pkgBaseFileName = pkgBaseFileName)
```

`r knit(text = chunkSource)`

# 3. Post-installation

Successful installation can be confirmed by loading the package into the workspace
Expand Down

0 comments on commit 362be20

Please sign in to comment.