Skip to content

Commit

Permalink
Merge pull request #394 from bjohnso005/master
Browse files Browse the repository at this point in the history
[v2.0.4] skip_on_cran & spanish vignette
  • Loading branch information
gepinillab authored Mar 11, 2023
2 parents 17ff906 + 24031f8 commit 7032789
Show file tree
Hide file tree
Showing 12 changed files with 623 additions and 25 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: wallace
Version: 2.0.3
Date: 2023-01-16
Version: 2.0.4
Date: 2023-03-11
Title: A Modular Platform for Reproducible Modeling of Species Niches
and Distributions
Description: The 'shiny' application Wallace is a modular platform for
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
wallace 2.0.4
=============
- Added Spanish translation of vignette
- Updates to v2 vignette
- `skip_on_cran()` added to several tests

wallace 2.0.3
=============
- Fix conditional in test for occs_queryDB
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![R-CMD-check](https://github.com/wallaceEcoMod/wallace/workflows/R-CMD-check/badge.svg)](https://github.com/wallaceEcoMod/wallace/actions) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![CRAN version](http://www.r-pkg.org/badges/version/wallace)](https://CRAN.R-project.org/package=wallace) [![downloads](https://cranlogs.r-pkg.org:443/badges/grand-total/wallace?color=orange)](https://cranlogs.r-pkg.org:443/badges/grand-total/wallace?color=orange)

# Wallace (v2.0.3)
# Wallace (v2.0.4)

*Wallace* is a modular platform for reproducible modeling of species niches and distributions, written in R. The application guides users through a complete analysis, from the acquisition of data to visualizing model predictions on an interactive map, thus bundling complex workflows into a single, streamlined interface.

Expand All @@ -27,7 +27,7 @@ run_wallace()
Please make sure you have installed the latest versions of both R (<a href= "https://cran.r-project.org/bin/macosx/" target="_blank">Mac OS</a>, <a href= "https://cran.r-project.org/bin/windows/base/" target="_blank">Windows</a>) and RStudio (<a href= "https://posit.co/download/rstudio-desktop/" target="_blank">Mac OS / Windows</a>: choose the free version).

#### How to run Maxent with maxent.jar
*Wallace* v2.0.3 includes two options to run Maxent models: maxnet and maxent.jar. The former, which is an R implementation and fits the model with the package `glmnet`, is now the default and does not require the package `rJava` (see Phillips et al. 2017). The latter, which is the Java implementation, runs the `maxent()` function in the package `dismo`. This function requires the user to place the `maxent.jar` file in the `/java` directory of the `dismo` package root folder. You can download Maxent <a href="https://biodiversityinformatics.amnh.org/open_source/maxent/" target="_blank">here</a>, and locate `maxent.jar`, which is the Maxent program itself, in the downloaded folder. You can find the directory path to `dismo/java` by running `system.file('java', package="dismo")` at the R console. Simply copy `maxent.jar` and paste it into this folder. If you try to run Maxent in *Wallace* without the file in place, you will get a warning message in the log window and Maxent will not run.
*Wallace* v2.0.4 includes two options to run Maxent models: maxnet and maxent.jar. The former, which is an R implementation and fits the model with the package `glmnet`, is now the default and does not require the package `rJava` (see Phillips et al. 2017). The latter, which is the Java implementation, runs the `maxent()` function in the package `dismo`. This function requires the user to place the `maxent.jar` file in the `/java` directory of the `dismo` package root folder. You can download Maxent <a href="https://biodiversityinformatics.amnh.org/open_source/maxent/" target="_blank">here</a>, and locate `maxent.jar`, which is the Maxent program itself, in the downloaded folder. You can find the directory path to `dismo/java` by running `system.file('java', package="dismo")` at the R console. Simply copy `maxent.jar` and paste it into this folder. If you try to run Maxent in *Wallace* without the file in place, you will get a warning message in the log window and Maxent will not run.

### Potential Issues

Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/Rmd/text_about.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output: html_document

<img src="logo.png" alt="logo" style="width: 150px; float:right; padding:10px;"/>

Welcome to *Wallace*, a flexible application for reproducible ecological modeling, built for community expansion. The current version of *Wallace* (v2.0.3) steps the user through a full niche/distribution modeling analysis, from data acquisition to visualizing results.
Welcome to *Wallace*, a flexible application for reproducible ecological modeling, built for community expansion. The current version of *Wallace* (v2.0.4) steps the user through a full niche/distribution modeling analysis, from data acquisition to visualizing results.

The application is written in `R` with the web app development package `shiny`. Please find the stable version of *Wallace* on <a href="https://CRAN.R-project.org/package=wallace" target="_blank">CRAN</a>, and the development version on <a href="https://github.com/wallaceEcoMod/wallace" target="_blank">Github</a>. We also maintain a *Wallace* <a href="https://wallaceecomod.github.io/" target="_blank">website</a> that has some basic info, links, and will be updated with tutorial materials in the near future.

Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/Rmd/text_intro_tab.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ output: html_document

#### WORKFLOW

*Wallace* (v2.0.3) currently includes ten components, or steps of a possible workflow. Each component includes two or more modules, which are possible analyses for that step.
*Wallace* (v2.0.4) currently includes ten components, or steps of a possible workflow. Each component includes two or more modules, which are possible analyses for that step.

**Components:**

Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/Rmd/userReport_intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ knit_engines$set(asis = function(options) {
knitr::opts_chunk$set(message = FALSE, warning = FALSE, eval = FALSE)
```

Please find below the R code history from your *Wallace* v2.0.3 session.
Please find below the R code history from your *Wallace* v2.0.4 session.

You can reproduce your session results by running this R Markdown file in RStudio.

Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test_envs_ecoClimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ bcScenarioFail='Present'

##start testing
test_that('error_checks', {
# skip on CRAN
skip_on_cran()
# Skip if cannot download
skip_if(class(varsEcoClimate) == "try-error")
##wrong AOGCM
Expand All @@ -40,6 +42,8 @@ test_that('error_checks', {
})

test_that('output_checks', {
# skip on CRAN
skip_on_cran()
# Skip if cannot download
skip_if(class(varsEcoClimate) == "try-error")
#output is a rasterstack
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test_envs_worldclim.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ test_that("error checks", {

### test output features
test_that("output type checks", {
# skip on CRAN
skip_on_cran()
# the output is a RasterBrick
expect_is(arcmin10, "RasterStack")
# the number of layer is the same as specified in the selected variables list
Expand Down
10 changes: 7 additions & 3 deletions tests/testthat/test_occs_paleoDb.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ context("paleoDb")
spName <- "Didelphis virginiana"
spNameError <- "Panthera onc"
genus <- "panthera"
#maximum number of occurences to download
#maximum number of occurrences to download
occNum <- 100
# For PaleobioDB only Holocene is allowed.
timeInterval <- "Holocene"
Expand All @@ -19,7 +19,7 @@ if (Sys.info()['sysname'] != "Windows") {
}


###Test that erorrs check
###Test that errors check
### test if the error messages appear when they are supposed to
test_that("error checks", {
# paleobioDB failing in Windows
Expand Down Expand Up @@ -56,6 +56,8 @@ test_that("error checks", {
test_that("output type checks", {
# paleobioDB failing in Windows
skip_on_os("windows")
# skip on CRAN
skip_on_cran()
#output is a list
expect_is(occsPaleo, "list")
#List has two elements
Expand All @@ -64,6 +66,8 @@ test_that("output type checks", {
test_that("output data checks", {
# paleobioDB failing in Windows
skip_on_os("windows")
# skip on CRAN
skip_on_cran()
# if the original database has records without coordinates OR duplicates:
if ((TRUE %in% duplicated(occsPaleo$orig[,c('longitude','latitude')]) == TRUE) |
(NA %in% occsPaleo$orig[,c('longitude','latitude')]) == TRUE){
Expand Down Expand Up @@ -93,7 +97,7 @@ test_that("headers check", {
skip_on_os("windows")
#
expect_false('FALSE' %in% (keyPaleoHeaders %in% names(occsPaleo$orig)))
# the headers in the claned table are the ones specified in the function
# the headers in the cleaned table are the ones specified in the function
expect_equal(names(occsPaleo$cleaned),c(keyPaleoHeaders,"pop"))
})

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test_occs_queryDb.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ test_that("GBIF headers", {
skip_if(class(out.gbif) == "try-error")
# the original headers haven't changed
expect_false('FALSE' %in% (headersGBIF %in% names(out.gbif[[i]]$orig)))
# the headers in the claned table are the ones specified in the function
# the headers in the cleaned table are the ones specified in the function
expect_equal(names(out.gbif[[i]]$cleaned),
c("occID", "scientific_name", "longitude", "latitude", "country",
"state_province", "locality", "year", "record_type",
Expand Down Expand Up @@ -242,7 +242,7 @@ for (i in 1:length(spNames)) {
# test_that("Bison headers", {
# # the original headers haven't changed
# expect_false('FALSE' %in% (headersBison %in% names(out.bison[[i]]$orig)))
# # the headers in the claned table are the ones specified in the function
# # the headers in the cleaned table are the ones specified in the function
# expect_equal(names(out.bison[[i]]$cleaned),
# c("occID", "scientific_name", "longitude", "latitude", "country",
# "state_province", "locality", "year", "record_type","catalog_number",
Expand Down Expand Up @@ -295,7 +295,7 @@ headersBien <- c("scrubbed_species_binomial", "longitude", "latitude",
# test_that("Bien headers", {
# # the original headers haven't changed
# expect_false('FALSE' %in% (headersBien %in% names(out.bien[[i]]$orig)))
# # the headers in the claned table are the ones specified in the function
# # the headers in the cleaned table are the ones specified in the function
# expect_equal(names(out.bien[[i]]$cleaned),
# c("occID", "scientific_name", "longitude", "latitude", "country",
# "state_province", "locality", "year", "record_type", "catalog_number",
Expand Down
Loading

0 comments on commit 7032789

Please sign in to comment.