Skip to content

Commit

Permalink
adpted installation instructions for pak
Browse files Browse the repository at this point in the history
  • Loading branch information
j-i-l committed Aug 6, 2024
1 parent 84593a2 commit 84efb1e
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Head over to our [version list](https://github.com/furrer-lab/abn/releases) to s
Here we assume the version is `3.1.1`.
We use [pak](https://pak.r-lib.org/) for the installation process.
If you followed the [Prior to installing](#prior-to-installing) section `pak` should already be installed
If you followed the [Prior to installing](#prior-to-installing) section `pak` should already be installed.
<details><summary>If not, install it first.</summary> Open an R session and type:
```R
Expand All @@ -316,23 +316,24 @@ To install `abn` run in your R session:
```R
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
pak::pkg_install("furrer-lab/abn@3.1.1", dependencies=TRUE)
```
_**Note:** The first command can be skipped or MacOS or Windows._
_**Note:** The first command can be skipped on MacOS or Windows._
## Installing from CRAN
Note that when installing from CRAN you might not get the latest version of `abn`.
If you want the latest version follow the instructions from [Installing from GitHub](#installing-from-github-recommended).
> [!NOTE]
> When installing from CRAN you might not get the latest version of `abn`.
> If you want the latest version follow the instructions from [Installing from GitHub](#installing-from-github-recommended).
In order to install the `abn` version on CRAN, open an R session and type:
```R
install.packages('abn', repos=c(CRAN="https://cran.r-project.org"))
pak::pkg_install("abn", dependencies=TRUE)
```
`anb` has several dependencies that are not available on CRAN.
This is why the [Prior to installing](#prior-to-installing) section should be followed through before installing `abn` from CRAN. [^1]
This is why we rely on [pak](https://pak.r-lib.org/) for the installation and the [Prior to installing](#prior-to-installing) section should be followed through before installing `abn` from CRAN. [^1]
[^1]: The `abn` package includes certain features, such as multiprocessing and integration with the `INLA` package, which are limited or available only on specific CRAN flavors.
While it is possible to relax the testing process by, e.g., excluding tests of these functionalities, we believe that rigorous testing is important for reliable software development, especially for a package like `abn` that includes complex functionalities.
Expand All @@ -358,22 +359,16 @@ Installing from source is done with the following steps:
cd abn
```

2. Install the dependencies by opening an R session and typing:

```R
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never', repos=c(CRAN="https://cran.r-project.org"))
```

3. Build the package by opening an R session and typing:
2. Deactivate `abn`'s development environment (a [renv](https://rstudio.github.io/renv/articles/renv.html) virtual environment):
```R
devtools::build(pkg = '.', path = '.build/abn.tar.gz', vignettes = FALSE)
renv::deactivate()
```
4. Install the package by opening an R session and typing:
3. Build and install the local content with dependencies:
```R
install.packages('.build/abn.tar.gz', repos=NULL, type="source")
pak::local_install(dependencies=TRUE)
```
# Quickstart
Expand Down

0 comments on commit 84efb1e

Please sign in to comment.