---
title: "SDMtune"
subtitle: "Species Distribution Model Selection"
bibliography: SDMtune.bib
output:
  html_document:
    theme: flatly
    highlight: default
    toc: true
    toc_depth: 2
vignette: >
  %\VignetteIndexEntry{SDMtune}
  %\VignetteEncoding{UTF-8}
  %\VignetteEngine{knitr::rmarkdown}
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
options(knitr.table.format = "html")
```

```{r load data, echo=FALSE, message=FALSE}
default_model <- SDMtune:::bm_maxent
```


# Set working environment

`SDMtune` package works with the new version of **MaxEnt** software (v. >= 3.4.1), in case you have the old version you can download the new one from [here](https://biodiversityinformatics.amnh.org/open_source/maxent/). The new version uses by default the **complementary log-log transform** (Cloglog) to produce the estimate of occurrence probability instead of the **logistic transform** and the feature class **threshold** is disabled but available as option [@Phillips2017].

If is the first time you use **MaxEnt** in R you have to make available the **maxent.jar** file for the `dismo` package [@Hijmans2017]. To do that copy the **maxent.jar** file in the folder named **java** inside the folder returned by the following command:

```{r, eval=FALSE}
system.file(package="dismo")
```

If you are an Ubuntu user you have to install **java** (e.g. install java openjdk with `sudo apt install openjdk-11-jdk`), check it with `java --version`, and then configure java for `R` using the command `sudo R CMD javareconf`.

Import `SDMtune`:
```{r import}
library(SDMtune)
```

Check if maxent is correctly configured for `dismo`:

```{r check maxent, eval=F}
dismo::maxent()
```

# References
