---
title: "1 - Install isobxr"
author: "Théo Tacail"
date: "`r Sys.Date()`" 
output: 
  rmarkdown::html_vignette:
    toc: true
    toc_depth: 2
vignette: >
  %\VignetteIndexEntry{1 - Install isobxr}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---


```{r, include = FALSE}
#####################################################################################
library(devtools)

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

----

[Full documentation and tutorials can be found on the isobxr website.](https://ttacail.github.io/isobxr_web/)

----

The [isobxr](https://ttacail.github.io/isobxr/) package is a set of R tools 
designed to perform and explore stable isotope box modelling 
of open or closed systems.
It provides a ready-to-use tool allowing users to 
develop and test isotopic box models of their system of interest. 
It allows the user to explore the behavior of these systems
in both static (*e.g.*, at steady state) or dynamic modes 
(*e.g.*, in reaction to a perturbation), 
build complex scenarios, and sweep the space of parameters in both static 
and dynamic modes.

----

# Installation

## Released version

The isobxr package is now on the [CRAN](https://cran.r-project.org/) (Comprehensive R Archive Network) 
and can be found on its [isobxr CRAN page](https://CRAN.R-project.org/package=isobxr). 

It is available as a released package and can be installed directly from CRAN by calling:

```{r eval = FALSE}
install.packages("isobxr")
```

## Development version

The [isobxr](https://ttacail.github.io/isobxr/) package is available as a source package in its development version
from the [GitHub isobxr master repository](https://github.com/ttacail/isobxr).

The isobxr development version can be installed as follows:

* Download and install/update [R](https://cran.r-project.org/) and 
[Rstudio](https://posit.co/download/rstudio-desktop/).

* Download and install package **devtools** as follows:

```{r eval = FALSE}
install.packages("devtools")
```

* Download and install [isobxr](https://ttacail.github.io/isobxr/) source package.

```{r eval = FALSE}
devtools::install_github("ttacail/isobxr/isobxr", build_vignettes = TRUE) # FALSE if no pandoc/Rstudio 
```

## Load **isobxr**
You can load the [isobxr](https://ttacail.github.io/isobxr/) package in R
as follows:
```{r eval = FALSE}
library(isobxr)
```

Here is the package description of the current version, 
where you can find the required minimal versions of dependencies:
```{r eval = FALSE}
packageDescription("isobxr")
```

You can locally browse the vignettes as follows:
```{r eval = FALSE}
browseVignettes("isobxr")
```

# Download templates and tutorials

The tutorial can be run using the tutorial files embedded in the package extdata. 
The tutorial files are then called by setting the workdir argument as follows: 
```{r eval = FALSE}
workdir <- "/Users/username/Documents/1_ABC_tutorial"
# or
workdir <- "use_isobxr_demonstration_files"
```

Note
:    The tutorial mode will prevent you from saving the run outputs to a local working directory.

Alternatively, the user is encouraged to download and browse the input files: 

1. [Download xlsx templates](https://ttacail.github.io/source/demos/0_excel_templates.zip).
These files provide the user with formatted master files, 
used as arguments to isobxr functions, as explained in vignettes and on the [isobxr website](https://ttacail.github.io/isobxr_web/).

2. [Download tutorial files](https://ttacail.github.io/source/demos/1_ABC_tutorial.zip). 
These files provide the user with all master files and R commands 
used throughout tutorials, as shown on the [isobxr website](https://ttacail.github.io/isobxr_web/).

----

