Skip to content

Commit

Permalink
Avoid error when maxent.jar is not present
Browse files Browse the repository at this point in the history
Former-commit-id: bda139c
  • Loading branch information
bobmuscarella committed Jan 9, 2017
1 parent 7fdc78d commit a24f100
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
Binary file added data/eval2.rda
Binary file not shown.
32 changes: 32 additions & 0 deletions man/eval2.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
\name{eval2}
\alias{eval2}
\docType{data}
\title{ An object of class "ENMevaluation" }
\description{ An example results file based on a call of ENMevaluate for use in the ENMeval vignette. }
\usage{ data(eval2) }
\format{
An object of class 'ENMevaluation' with nine slots:

\code{@ results} : data.frame of evaluation metrics

\code{@ predictions} : RasterStack of model predictions

\code{@ models}: list of \code{MaxEnt} model objects (see \code{MaxEnt} documentation for details)

\code{@ partition.method}: character giving method of data partitioning

\code{@ occ.pts} : data.frame of latitude and longitude of occurrence localities

\code{@ occ.grp} : data.frame of bins for occurrence localities

\code{@ bg.pts} : data.frame of latitude and longitude of background localities

\code{@ bg.grp} : data.frame of bins for background localities

\code{@ overlap} : matrix of pairwise niche overlap

}

\details{
The dataset is used for the ENMeval vignette.
}
17 changes: 11 additions & 6 deletions vignettes/ENMeval-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,17 @@ Unless you supply the function with background points (which is recommended in m

ENMevaluate builds a separate model for each unique combination of RM values and feature class combinations. For example, the following call will build and evaluate 2 models. One with RM=1 and another with RM=2, both allowing only linear features.

``` {r enmeval1a, results='hide', eval=FALSE}
```{r load_vignette_data, echo = FALSE}
data(eval2)
```

``` {r enmeval1a, eval=FALSE}
eval1 <- ENMevaluate(occs, envs, bg, method='checkerboard2', RMvalues=c(1,2), fc=c('L'))
```

We may, however, want to compare a wider range of models that can use a wider variety of feature classes:

``` {r enmeval1b, results='hide'}
``` {r enmeval1b, eval=FALSE}
eval2 <- ENMevaluate(occ=occs, env=envs, bg.coords=bg, method='checkerboard2', RMvalues=c(1,2), fc=c('L','LQ','LQP'))
```

Expand Down Expand Up @@ -402,9 +406,10 @@ plot(eval2@predictions[['LQP_1']], ylim=c(-30,20), xlim=c(-90,-40), legend=F, ma
```

#### Plotting response curves {#plot.resp}
We can also plot the response curves of our model to see how different input variables influence our model predictions.
``` {r plot.pred3, fig.width = 5, fig.height = 5}
response(eval2@models[[1]])
We can also plot the response curves of our model to see how different input variables influence our model predictions. (Note that, as with the `dismo::maxent` function, using this function requires that the maxent.jar file be installed in the `dismo` package java folder).

``` {r response_curves, eval=FALSE}
response(eval2@models[[1]])
```

## Downstream Analyses (*under construction*) {#downstream}
Expand All @@ -418,7 +423,7 @@ Below is a running list of other things we plan to add to this vignette. Feel f
## Resources (*under construction*) {#resources}

###### Web Resources
- [Hijmans, R. and Elith, J. (2016) Species distribution modeling with R. dismo vignette.](https://cran.r-project.org/web/package=dismo)
- [Hijmans, R. and Elith, J. (2016) Species distribution modeling with R. dismo vignette.](https://cran.r-project.org/package=dismo)

- [Phillips, S. J. (2006) Phillips, S. (2006) A brief tutorial on Maxent. AT&T Research. Available at: http://www.cs.princeton.edu/~schapire/maxent/tutorial/tutorial.doc](http://www.cs.princeton.edu/~schapire/maxent/tutorial/tutorial.doc)

Expand Down

0 comments on commit a24f100

Please sign in to comment.