diff --git a/.github/workflows/R-CMD-check-macos.yaml b/.github/workflows/R-CMD-check-macos.yaml
index 6404e91..8ff416b 100644
--- a/.github/workflows/R-CMD-check-macos.yaml
+++ b/.github/workflows/R-CMD-check-macos.yaml
@@ -39,26 +39,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- - uses: r-lib/actions/setup-r@v1
- with:
- r-version: ${{ matrix.config.r }}
+ - uses: r-lib/actions/setup-pandoc@v2
- - uses: r-lib/actions/setup-pandoc@v1
-
- - name: Query dependencies
- run: |
- install.packages('remotes')
- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
- shell: Rscript {0}
-
- - name: Cache R packages
- if: runner.os != 'Windows'
- uses: actions/cache@v2
+ - uses: r-lib/actions/setup-r@v2
with:
- path: ${{ env.R_LIBS_USER }}
- key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
- restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
+ r-version: ${{ matrix.config.r }}
+ use-public-rspm: true
- name: Install system dependencies
run: |
@@ -66,13 +52,22 @@ jobs:
brew install mpfr
brew install automake
+ - uses: r-lib/actions/setup-r-dependencies@v2
+ with:
+ cache-version: 1
+ extra-packages: |
+ any::rcmdcheck
+ any::covr
+ any::remotes
+ gurobi=?ignore
+ needs: |
+ check
+ coverage
+
- name: Install dependencies
run: |
- options("install.packages.compile.from.source" = "never")
- remotes::install_deps(dependencies = TRUE)
- remotes::install_cran("rcmdcheck")
- remotes::install_cran("covr")
options("install.packages.compile.from.source" = "yes")
+ remotes::install_cran("sf")
remotes::install_cran("RcppAlgos")
shell: Rscript {0}
@@ -83,19 +78,11 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- - name: Check
- run: |
- rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
- shell: Rscript {0}
+ - uses: r-lib/actions/check-r-package@v2
+ with:
+ upload-snapshots: true
- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
-
- - name: Upload check results
- if: failure()
- uses: actions/upload-artifact@main
- with:
- name: ${{ runner.os }}-r${{ matrix.config.r }}-results
- path: check
diff --git a/DESCRIPTION b/DESCRIPTION
index 4c1ab2b..16f87c7 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
Package: surveyvoi
Type: Package
-Version: 1.0.5.1
+Version: 1.0.6
Title: Survey Value of Information
Description: Decision support tool for prioritizing sites for ecological
surveys based on their potential to improve plans for conserving
@@ -74,7 +74,6 @@ License: GPL-3
LazyData: true
Language: en-US
SystemRequirements:
- C++11,
JAGS (>= 4.3.0) (optional),
fftw3 (>= 3.3),
gmp (>= 6.2.1),
@@ -85,7 +84,7 @@ SystemRequirements:
URL: https://prioritizr.github.io/surveyvoi/
BugReports: https://github.com/prioritizr/surveyvoi/issues
VignetteBuilder: knitr
-RoxygenNote: 7.2.3
+RoxygenNote: 7.3.1
Encoding: UTF-8
Biarch: true
Collate:
diff --git a/NEWS.md b/NEWS.md
index 6be89d5..a5bc177 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,9 @@
+# surveyvoi 1.0.6
+
+- Fix installation for Windows on arm64 (#50).
+- Fix aliasing for package overview help file (#49).
+- Remove CXX specification in Makevars to avoid NOTEs in package checks.
+
# surveyvoi 1.0.5.1
- Update citation.
diff --git a/R/env_div_survey_scheme.R b/R/env_div_survey_scheme.R
index fa8a53c..2395036 100644
--- a/R/env_div_survey_scheme.R
+++ b/R/env_div_survey_scheme.R
@@ -69,7 +69,7 @@ NULL
#' install the [Gurobi optimization software](https://www.gurobi.com/) and the
#' \pkg{gurobi} R package because it can generate survey schemes much faster.
#' Note that special academic licenses are available at no cost.
-#' Installation instructions are available online for [Linux](https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html), [Windows](https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html), and [Mac OS](https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html) operating systems.
+#' Installation instructions are [available online for Linux, Windows, and Mac OS operating systems](https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer).
#'
#' @references
#' Faith DP & Walker PA (1996) Environmental diversity: on the best-possible
diff --git a/R/feasible_survey_schemes.R b/R/feasible_survey_schemes.R
index de68697..f9441cd 100644
--- a/R/feasible_survey_schemes.R
+++ b/R/feasible_survey_schemes.R
@@ -23,7 +23,8 @@ NULL
#' Please note that this function requires the Gurobi optimization software
#' ( The funding available for conservation is limited. To ensure that conservation funds are allocated cost-effectively, conservation plans (termed prioritizations) can be developed – using a combination of economic, biodiversity, and land-use data – to prioritize a set of sites for conservation management (e.g. protected area establishment). However, existing data on biodiversity patterns are incomplete. As a consequence, prioritizations can potentially be improved by collecting additional data. Specifically, ecological surveys can be conducted in sites to learn more about which species are present within them. However, conducting ecological surveys reduces the funds available for conservation management. Thus, decision makers need to strategically allocate funding for surveying sites and managing them for conservation—this is not a trivial task. The surveyvoi R package is a decision support tool for prioritizing sites for ecological surveys based on their potential to improve plans for conserving biodiversity (e.g. plans for establishing protected areas). Given a set of sites that could potentially be acquired for conservation management – wherein some sites have previously been surveyed and other sites have not – it can be used to generate and evaluate plans for additional surveys. Specifically, plans for ecological surveys can be generated using various conventional approaches (e.g. maximizing expected species richness, geographic coverage, diversity of sampled environmental conditions) and directly maximizing value of information using optimization algorithms. After generating plans for surveys, they can also be evaluated using value of information analysis. Please note that several functions depend on the ‘Gurobi’ optimization software (available from https://www.gurobi.com) and the gurobi R package (installation instructions available for Linux, Windows, and Mac OS). The surveyvoi R package is a decision support tool for prioritizing sites for ecological surveys based on their potential to improve plans for conserving biodiversity (e.g. plans for establishing protected areas). Given a set of sites that could potentially be acquired for conservation management – wherein some sites have previously been surveyed and other sites have not – it can be used to generate and evaluate plans for additional surveys. Specifically, plans for ecological surveys can be generated using various conventional approaches (e.g. maximizing expected species richness, geographic coverage, diversity of sampled environmental conditions) and directly maximizing value of information using optimization algorithms. After generating plans for surveys, they can also be evaluated using value of information analysis. Please note that several functions depend on the ‘Gurobi’ optimization software (available from https://www.gurobi.com) and the gurobi R package (installation instructions available for online Linux, Windows, and Mac OS). This tutorial provides a brief overview of the surveyvoi R package. Here, we will simulate survey data, fit statistical models to characterize the spatial distribution of a simulated species, and generate and evaluate survey schemes based on different approaches. Although this tutorial deals with only a single simulated species – to keep the tutorial simple and reduce computational burden – the functions used in this tutorial are designed to work with multiple species. If you want to learn more about a specific function, please consult the documentation written specifically for the function (accessible using the R code Please note that this function requires the Gurobi optimization software
(https://www.gurobi.com/) and the gurobi R package if different
sites have different survey costs. Installation instruction are available
-online for for Linux, Windows, and Mac OS.surveyvoi: Survey Value of Information
Jeffrey O. Hanson
- 2023-02-24
+ 2024-02-14
Source: vignettes/surveyvoi.Rmd
surveyvoi.Rmd
2023-02-24
Introduction
?function
, where function
is the name of desired function).Simulate data## 8 (0.590849 0.748232)
## 9 (0.373888 0.150227)
## 10 (0.141298 0.307626)
-## # … with 20 more rows
+## # ℹ 20 more rows
+## # ℹ 20 more rows
# plot the spatial location of the sites
ggplot(site_data) +
@@ -303,7 +303,7 @@
Modeling probability of occupancy## 8 0.565847
## 9 0.452463
## 10 0.565847
-## # … with 20 more rows
site_data$p1 <- xgb_predictions$f1
diff --git a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-13-1.png
index cab44ec..84354da 100644
Binary files a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-13-1.png and b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-13-1.png differ
diff --git a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-21-1.png b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-21-1.png
index fd0c58e..2099915 100644
Binary files a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-21-1.png and b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-21-1.png differ
diff --git a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-27-1.png b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-27-1.png
index 4dc472b..b4c59a6 100644
Binary files a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-27-1.png and b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-27-1.png differ
diff --git a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-5-1.png
index 32df4e1..aefaa9b 100644
Binary files a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-6-1.png
index 84bc7c3..1499286 100644
Binary files a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-7-1.png
index 420cff2..a806b3f 100644
Binary files a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-8-1.png
index a200996..378bf10 100644
Binary files a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-9-1.png
index c89c4d2..52d2016 100644
Binary files a/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/surveyvoi_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/authors.html b/docs/authors.html
index 97b06e7..9f90030 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -17,7 +17,7 @@
Changelog
Source: NEWS.md
+
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 386449a..39fd920 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -3,7 +3,7 @@ pkgdown: 2.0.7
pkgdown_sha: ~
articles:
surveyvoi: surveyvoi.html
-last_built: 2023-02-24T01:05Z
+last_built: 2024-02-14T22:16Z
urls:
reference: https://github.com/prioritizr/surveyvoi/reference
article: https://github.com/prioritizr/surveyvoi/articles
diff --git a/docs/reference/approx_evdsi.html b/docs/reference/approx_evdsi.html
index 2aeeda4..06eddb6 100644
--- a/docs/reference/approx_evdsi.html
+++ b/docs/reference/approx_evdsi.html
@@ -21,7 +21,7 @@
@@ -298,27 +298,26 @@ Examples
#> Bounding box: xmin: 0.10513 ymin: 0.04556193 xmax: 0.9764926 ymax: 0.8637977
#> CRS: NA
#> # A tibble: 6 × 14
-#> surve…¹ manag…² f1 f2 f3 n1 n2 n3 e1 e2 p1 p2
-#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 14 102 1 1 1 3 3 3 1.00 -0.848 1 0.999
-#> 2 25 90 0 0 0 0 0 0 -1.44 1.27 0 0
-#> 3 25 165 1 0.6 0 5 5 5 1.25 0.817 1 0.419
-#> 4 17 104 0 0 0 0 0 0 -0.484 -0.292 0.022 0.502
-#> 5 18 100 0 0 0 0 0 0 0.0135 0.380 0.318 0.13
-#> 6 15 94 0 0 0 0 0 0 -0.347 -1.33 0.474 0.997
-#> # … with 2 more variables: p3 <dbl>, geometry <POINT>, and abbreviated variable
-#> # names ¹survey_cost, ²management_cost
+#> survey_cost management_cost f1 f2 f3 n1 n2 n3 e1 e2
+#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+#> 1 14 102 1 1 1 3 3 3 1.00 -0.848
+#> 2 25 90 0 0 0 0 0 0 -1.44 1.27
+#> 3 25 165 1 0.6 0 5 5 5 1.25 0.817
+#> 4 17 104 0 0 0 0 0 0 -0.484 -0.292
+#> 5 18 100 0 0 0 0 0 0 0.0135 0.380
+#> 6 15 94 0 0 0 0 0 0 -0.347 -1.33
+#> # ℹ 4 more variables: p1 <dbl>, p2 <dbl>, p3 <dbl>, geometry <POINT>
# load example feature data
data(sim_features)
print(sim_features)
#> # A tibble: 3 × 7
-#> name survey survey_sensitivity survey_specificity model_sens…¹ model…² target
-#> <chr> <lgl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 f1 TRUE 0.954 0.886 0.718 0.811 1
-#> 2 f2 TRUE 0.974 0.875 0.705 0.860 1
-#> 3 f3 TRUE 0.956 0.823 0.768 0.887 1
-#> # … with abbreviated variable names ¹model_sensitivity, ²model_specificity
+#> name survey survey_sensitivity survey_specificity model_sensitivity
+#> <chr> <lgl> <dbl> <dbl> <dbl>
+#> 1 f1 TRUE 0.954 0.886 0.718
+#> 2 f2 TRUE 0.974 0.875 0.705
+#> 3 f3 TRUE 0.956 0.823 0.768
+#> # ℹ 2 more variables: model_specificity <dbl>, target <dbl>
# set total budget for managing sites for conservation
# (i.e. 50% of the cost of managing all sites)
diff --git a/docs/reference/approx_near_optimal_survey_scheme.html b/docs/reference/approx_near_optimal_survey_scheme.html
index 257e7e3..6d807c5 100644
--- a/docs/reference/approx_near_optimal_survey_scheme.html
+++ b/docs/reference/approx_near_optimal_survey_scheme.html
@@ -20,7 +20,7 @@
@@ -358,27 +358,26 @@ Examples
#> Bounding box: xmin: 0.10513 ymin: 0.04556193 xmax: 0.9764926 ymax: 0.8637977
#> CRS: NA
#> # A tibble: 6 × 14
-#> surve…¹ manag…² f1 f2 f3 n1 n2 n3 e1 e2 p1 p2
-#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 14 102 1 1 1 3 3 3 1.00 -0.848 1 0.999
-#> 2 25 90 0 0 0 0 0 0 -1.44 1.27 0 0
-#> 3 25 165 1 0.6 0 5 5 5 1.25 0.817 1 0.419
-#> 4 17 104 0 0 0 0 0 0 -0.484 -0.292 0.022 0.502
-#> 5 18 100 0 0 0 0 0 0 0.0135 0.380 0.318 0.13
-#> 6 15 94 0 0 0 0 0 0 -0.347 -1.33 0.474 0.997
-#> # … with 2 more variables: p3 <dbl>, geometry <POINT>, and abbreviated variable
-#> # names ¹survey_cost, ²management_cost
+#> survey_cost management_cost f1 f2 f3 n1 n2 n3 e1 e2
+#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
+#> 1 14 102 1 1 1 3 3 3 1.00 -0.848
+#> 2 25 90 0 0 0 0 0 0 -1.44 1.27
+#> 3 25 165 1 0.6 0 5 5 5 1.25 0.817
+#> 4 17 104 0 0 0 0 0 0 -0.484 -0.292
+#> 5 18 100 0 0 0 0 0 0 0.0135 0.380
+#> 6 15 94 0 0 0 0 0 0 -0.347 -1.33
+#> # ℹ 4 more variables: p1 <dbl>, p2 <dbl>, p3 <dbl>, geometry <POINT>
# load example feature data
data(sim_features)
print(sim_features)
#> # A tibble: 3 × 7
-#> name survey survey_sensitivity survey_specificity model_sens…¹ model…² target
-#> <chr> <lgl> <dbl> <dbl> <dbl> <dbl> <dbl>
-#> 1 f1 TRUE 0.954 0.886 0.718 0.811 1
-#> 2 f2 TRUE 0.974 0.875 0.705 0.860 1
-#> 3 f3 TRUE 0.956 0.823 0.768 0.887 1
-#> # … with abbreviated variable names ¹model_sensitivity, ²model_specificity
+#> name survey survey_sensitivity survey_specificity model_sensitivity
+#> <chr> <lgl> <dbl> <dbl> <dbl>
+#> 1 f1 TRUE 0.954 0.886 0.718
+#> 2 f2 TRUE 0.974 0.875 0.705
+#> 3 f3 TRUE 0.956 0.823 0.768
+#> # ℹ 2 more variables: model_specificity <dbl>, target <dbl>
# set total budget for managing sites for conservation
# (i.e. 50% of the cost of managing all sites)
diff --git a/docs/reference/approx_optimal_survey_scheme.html b/docs/reference/approx_optimal_survey_scheme.html
index c5677b5..c7577c4 100644
--- a/docs/reference/approx_optimal_survey_scheme.html
+++ b/docs/reference/approx_optimal_survey_scheme.html
@@ -19,7 +19,7 @@
@@ -320,7 +320,8 @@ Dependencies
Please note that this function requires the Gurobi optimization software (https://www.gurobi.com/) and the gurobi R package if different sites have different survey costs. Installation instruction are available -online for for Linux, Windows, and Mac OS.
+online for Linux, Windows, and Mac OS +(see https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer).Summary of the package
surveyvoi: Survey Value of Information
Please note that this function requires the Gurobi optimization software (https://www.gurobi.com/) and the gurobi R package if different sites have different survey costs. Installation instruction are available -online for for Linux, Windows, and Mac OS.
+online for Linux, Windows, and Mac OS +(see https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer).Please note that several functions depend on the 'Gurobi' optimization software (available from https://www.gurobi.com) -and the gurobi R package (installation instructions available for -Linux, Windows, and Mac OS). +and the gurobi R package (installation instructions +available online for Linux, Windows, and Mac OS). Additionally, the JAGS software (available from https://mcmc-jags.sourceforge.io/) is required to fit hierarchical generalized linear models.
@@ -93,6 +93,13 @@The package vignette provides a tutorial
(accessible using the code vignettes("surveyvoi")
).
The funding available for conservation is limited. To ensure that conservation funds are allocated cost-effectively, conservation plans (termed prioritizations) can be developed – using a combination of economic, biodiversity, and land-use data – to prioritize a set of sites for conservation management (e.g. protected area establishment). However, existing data on biodiversity patterns are incomplete. As a consequence, prioritizations can potentially be improved by collecting additional data. Specifically, ecological surveys can be conducted in sites to learn more about which species are present within them. However, conducting ecological surveys reduces the funds available for conservation management. Thus, decision makers need to strategically allocate funding for surveying sites and managing them for conservation—this is not a trivial task.
-The surveyvoi R package is a decision support tool for prioritizing sites for ecological surveys based on their potential to improve plans for conserving biodiversity (e.g. plans for establishing protected areas). Given a set of sites that could potentially be acquired for conservation management – wherein some sites have previously been surveyed and other sites have not – it can be used to generate and evaluate plans for additional surveys. Specifically, plans for ecological surveys can be generated using various conventional approaches (e.g. maximizing expected species richness, geographic coverage, diversity of sampled environmental conditions) and directly maximizing value of information using optimization algorithms. After generating plans for surveys, they can also be evaluated using value of information analysis. Please note that several functions depend on the ‘Gurobi’ optimization software (available from https://www.gurobi.com) and the gurobi R package (installation instructions available for Linux, Windows, and Mac OS).
+The surveyvoi R package is a decision support tool for prioritizing sites for ecological surveys based on their potential to improve plans for conserving biodiversity (e.g. plans for establishing protected areas). Given a set of sites that could potentially be acquired for conservation management – wherein some sites have previously been surveyed and other sites have not – it can be used to generate and evaluate plans for additional surveys. Specifically, plans for ecological surveys can be generated using various conventional approaches (e.g. maximizing expected species richness, geographic coverage, diversity of sampled environmental conditions) and directly maximizing value of information using optimization algorithms. After generating plans for surveys, they can also be evaluated using value of information analysis. Please note that several functions depend on the ‘Gurobi’ optimization software (available from https://www.gurobi.com) and the gurobi R package (installation instructions available for online Linux, Windows, and Mac OS).
This tutorial provides a brief overview of the surveyvoi R package. Here, we will simulate survey data, fit statistical models to characterize the spatial distribution of a simulated species, and generate and evaluate survey schemes based on different approaches. Although this tutorial deals with only a single simulated species – to keep the tutorial simple and reduce computational burden – the functions used in this tutorial are designed to work with multiple species. If you want to learn more about a specific function, please consult the documentation written specifically for the function (accessible using the R code ?function
, where function
is the name of desired function).
# plot the spatial location of the sites
ggplot(site_data) +
geom_sf() +
ggtitle("Sites") +
labs(x = "X coordinate", y = "Y coordinate")
The site_data
object is a spatially explicit dataset (i.e. sf
object) that contains information on the site locations and additional site attributes. Here, each row corresponds to a different site, and each column contains a different site attribute. The f1
column contains the results from previous surveys, where values describe the proportion of previous surveys where species were previously detected at each site. Since each site has had at most a single previous survey, these data contain zeros (indicating that the species has not been detected) and ones (indicating that the species has been detected). The n1
column contains the number of previous surveys conducted within each site. Thus, sites with zeros in this column have not previously been surveyed. The e1
, e2
, and e3
columns contain environmental information for each site (e.g. normalized temperature and rainfall data). The survey_cost
column contains the cost of surveying each site, and the management_cost
column contains the cost of managing each site for conservation.
To help understand the simulated data, let’s create some visualizations.
# plot site occupancy data from previous surveys
@@ -276,7 +276,7 @@ Simulate data
facet_wrap(~ name) +
labs(title = "Detection/non-detection data",
x = "X coordinate", y = "Y coordinate")
# plot number of previous surveys within each site
%>%
site_data select(starts_with("n")) %>%
@@ -288,7 +288,7 @@ Simulate data
facet_wrap(~ name) +
labs(title = "Number of previous surveys",
x = "X coordinate", y = "Y coordinate")
# plot site cost data
# note that survey and management costs are on different scales
<- ggplot(site_data) +
@@ -302,7 +302,7 @@ p1 Simulate data
labs(title = "Management cost", x = "X coordinate", y = "Y coordinate") +
theme(legend.title = element_blank())
grid.arrange(p1, p2, nrow = 1)
# plot site environmental data
%>%
site_data select(starts_with("e")) %>%
@@ -313,7 +313,7 @@ Simulate data
scale_color_viridis() +
labs(title = "Environmental conditions",
x = "X coordinate", y = "Y coordinate")
After simulating data for the sites, we will simulate data for the conservation feature. We set proportion_of_survey_features = 1
to indicate that this feature will be examined in future surveys.
# simulate feature data
<- simulate_feature_data(
@@ -395,7 +395,7 @@ feature_data Modeling probability of occupancy
## 8 0.565847
## 9 0.452463
## 10 0.565847
-## # … with 20 more rows
+## # ℹ 20 more rows
$p1 <- xgb_predictions$f1 site_data
# plot site-level estimated occupancy probabilities
%>%
@@ -406,7 +406,7 @@ site_data Modeling probability of occupancy
facet_wrap(~name) +
scale_color_viridis() +
labs(title = "Modeled probabilities", x = "X coordinate", y = "Y coordinate")
We can see that different approaches yield different survey schemes – but how well do they perform?
We can see that the optimized survey scheme (opt_scheme
) is different to the previous survey schemes.
# calculate expected value of sample information for the optimized scheme
<- evdsi(
diff --git a/man/approx_optimal_survey_scheme.Rd b/man/approx_optimal_survey_scheme.Rd
index 84fc565..3144abc 100644
--- a/man/approx_optimal_survey_scheme.Rd
+++ b/man/approx_optimal_survey_scheme.Rd
@@ -208,7 +208,8 @@ this algorithm, it can take a very long time to complete.
Please note that this function requires the Gurobi optimization software
(\url{https://www.gurobi.com/}) and the \pkg{gurobi} R package if different
sites have different survey costs. Installation instruction are available
-online for for \href{https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html}{Linux}, \href{https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html}{Windows}, and \href{https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html}{Mac OS}.
+online for Linux, Windows, and Mac OS
+(see \url{https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer}).
}
\examples{
diff --git a/man/env_div_survey_scheme.Rd b/man/env_div_survey_scheme.Rd
index 6c5f5c9..64e6acb 100644
--- a/man/env_div_survey_scheme.Rd
+++ b/man/env_div_survey_scheme.Rd
@@ -92,7 +92,7 @@ The Comprehensive R Archive Network (CRAN), it is strongly recommended to
install the \href{https://www.gurobi.com/}{Gurobi optimization software} and the
\pkg{gurobi} R package because it can generate survey schemes much faster.
Note that special academic licenses are available at no cost.
-Installation instructions are available online for \href{https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html}{Linux}, \href{https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html}{Windows}, and \href{https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html}{Mac OS} operating systems.
+Installation instructions are \href{https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer}{available online for Linux, Windows, and Mac OS operating systems}.
}
\examples{
diff --git a/man/feasible_survey_schemes.Rd b/man/feasible_survey_schemes.Rd
index 04972f4..54201ea 100644
--- a/man/feasible_survey_schemes.Rd
+++ b/man/feasible_survey_schemes.Rd
@@ -56,7 +56,8 @@ survey schemes given survey costs and a fixed budget.
Please note that this function requires the Gurobi optimization software
(\url{https://www.gurobi.com/}) and the \pkg{gurobi} R package if different
sites have different survey costs. Installation instruction are available
-online for for \href{https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html}{Linux}, \href{https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html}{Windows}, and \href{https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html}{Mac OS}.
+online for Linux, Windows, and Mac OS
+(see \url{https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer}).
}
\examples{
diff --git a/man/figures/README-f_plot-1.png b/man/figures/README-f_plot-1.png
index 4d01fc3..877f57c 100644
Binary files a/man/figures/README-f_plot-1.png and b/man/figures/README-f_plot-1.png differ
diff --git a/man/figures/README-n_plot-1.png b/man/figures/README-n_plot-1.png
index b996b61..382fb91 100644
Binary files a/man/figures/README-n_plot-1.png and b/man/figures/README-n_plot-1.png differ
diff --git a/man/figures/README-p_plot-1.png b/man/figures/README-p_plot-1.png
index e39d618..06e3ae1 100644
Binary files a/man/figures/README-p_plot-1.png and b/man/figures/README-p_plot-1.png differ
diff --git a/man/figures/README-unnamed-chunk-10-1.png b/man/figures/README-unnamed-chunk-10-1.png
index ba3e694..bdb9fa3 100644
Binary files a/man/figures/README-unnamed-chunk-10-1.png and b/man/figures/README-unnamed-chunk-10-1.png differ
diff --git a/man/figures/README-unnamed-chunk-6-1.png b/man/figures/README-unnamed-chunk-6-1.png
index b4a5147..979b54e 100644
Binary files a/man/figures/README-unnamed-chunk-6-1.png and b/man/figures/README-unnamed-chunk-6-1.png differ
diff --git a/man/figures/README-unnamed-chunk-6-2.png b/man/figures/README-unnamed-chunk-6-2.png
index fed8029..b27de80 100644
Binary files a/man/figures/README-unnamed-chunk-6-2.png and b/man/figures/README-unnamed-chunk-6-2.png differ
diff --git a/man/geo_cov_survey_scheme.Rd b/man/geo_cov_survey_scheme.Rd
index 44e1608..89cfc5b 100644
--- a/man/geo_cov_survey_scheme.Rd
+++ b/man/geo_cov_survey_scheme.Rd
@@ -78,7 +78,7 @@ The Comprehensive R Archive Network (CRAN), it is strongly recommended to
install the \href{https://www.gurobi.com/}{Gurobi optimization software} and the
\pkg{gurobi} R package because it can generate survey schemes much faster.
Note that special academic licenses are available at no cost.
-Installation instructions are available online for \href{https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html}{Linux}, \href{https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html}{Windows}, and \href{https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html}{Mac OS} operating systems.
+Installation instructions are \href{https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer}{available online for Linux, Windows, and Mac OS operating systems}.
}
\examples{
diff --git a/man/optimal_survey_scheme.Rd b/man/optimal_survey_scheme.Rd
index f4c366b..096634c 100644
--- a/man/optimal_survey_scheme.Rd
+++ b/man/optimal_survey_scheme.Rd
@@ -190,7 +190,8 @@ this algorithm, it can take a very long time to complete.
Please note that this function requires the Gurobi optimization software
(\url{https://www.gurobi.com/}) and the \pkg{gurobi} R package if different
sites have different survey costs. Installation instruction are available
-online for for \href{https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html}{Linux}, \href{https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html}{Windows}, and \href{https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html}{Mac OS}.
+online for Linux, Windows, and Mac OS
+(see \url{https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer}).
}
\examples{
diff --git a/man/surveyvoi.Rd b/man/surveyvoi.Rd
index cfd6ffe..6e8f66d 100644
--- a/man/surveyvoi.Rd
+++ b/man/surveyvoi.Rd
@@ -3,6 +3,7 @@
\docType{package}
\name{surveyvoi}
\alias{surveyvoi}
+\alias{surveyvoi-package}
\title{surveyvoi: Survey Value of Information}
\description{
Decision support tool for prioritizing sites for ecological
@@ -21,8 +22,8 @@ value of information analysis.
\details{
Please note that several functions depend on
the 'Gurobi' optimization software (available from \url{https://www.gurobi.com})
-and the \pkg{gurobi} R package (installation instructions available for
-\href{https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html}{Linux}, \href{https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html}{Windows}, and \href{https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html}{Mac OS}).
+and the \pkg{gurobi} R package (installation instructions
+\href{https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer}{available online for Linux, Windows, and Mac OS}).
Additionally, the JAGS software
(available from \url{https://mcmc-jags.sourceforge.io/}) is required to fit
hierarchical generalized linear models.
@@ -31,3 +32,12 @@ hierarchical generalized linear models.
The package vignette provides a tutorial
(accessible using the code \code{vignettes("surveyvoi")}).
}
+\author{
+Package authors:
+\itemize{
+\item Jeffrey O. Hanson \email{jeffrey.hanson@uqconnect.edu.au} \href{https://orcid.org/0000-0002-4716-6134}{ORCID}
+\item Iadine Chadès \email{iadine.chades@csiro.au} \href{https://orcid.org/0000-0002-7442-2850}{ORCID}
+\item Emma J. Hudgins \email{emma.hudgins@mail.mcgill.ca} \href{https://orcid.org/0000-0002-8402-5111}{ORCID}
+\item Joseph R. Bennett \email{joseph.bennett@carleton.ca} \href{https://orcid.org/0000-0002-3901-9513}{ORCID}
+}
+}
diff --git a/man/weighted_survey_scheme.Rd b/man/weighted_survey_scheme.Rd
index 5c1521a..4957e1d 100644
--- a/man/weighted_survey_scheme.Rd
+++ b/man/weighted_survey_scheme.Rd
@@ -89,7 +89,7 @@ The Comprehensive R Archive Network (CRAN), it is strongly recommended to
install the \href{https://www.gurobi.com/}{Gurobi optimization software} and the
\pkg{gurobi} R package because it can generate survey schemes much faster.
Note that special academic licenses are available at no cost.
-Installation instructions are available online for \href{https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html}{Linux}, \href{https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html}{Windows}, and \href{https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html}{Mac OS} operating systems.
+Installation instructions are \href{https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer}{available online for Linux, Windows, and Mac OS operating systems}.
}
\examples{
diff --git a/src/Makevars.in b/src/Makevars.in
index 2aefe17..f4cf9cb 100644
--- a/src/Makevars.in
+++ b/src/Makevars.in
@@ -1,4 +1,3 @@
-CXX_STD = CXX11
PKG_CPPFLAGS = @PKG_CPPFLAGS@
PKG_LIBS = @PKG_LIBS@
diff --git a/src/Makevars.win b/src/Makevars.win
index ccadb75..ebe2af0 100644
--- a/src/Makevars.win
+++ b/src/Makevars.win
@@ -2,8 +2,6 @@ VERSION = 6.1.2
RWINLIB = ../windows/gmp-$(VERSION)
BUILD = ${subst gcc ,-,${R_COMPILED_BY}}
-CXX_STD = CXX11
-
# PKG_CXXFLAGS = -Wno-ignored-attributes # uncomment for debugging
PKG_CPPFLAGS = -I$(RWINLIB)/include
diff --git a/vignettes/surveyvoi.Rmd b/vignettes/surveyvoi.Rmd
index 164ea9b..b21c3e8 100644
--- a/vignettes/surveyvoi.Rmd
+++ b/vignettes/surveyvoi.Rmd
@@ -41,7 +41,7 @@ devtools::load_all()
The funding available for conservation is limited. To ensure that conservation funds are allocated cost-effectively, conservation plans (termed prioritizations) can be developed -- using a combination of economic, biodiversity, and land-use data -- to prioritize a set of sites for conservation management (e.g. protected area establishment). However, existing data on biodiversity patterns are incomplete. As a consequence, prioritizations can potentially be improved by collecting additional data. Specifically, ecological surveys can be conducted in sites to learn more about which species are present within them. However, conducting ecological surveys reduces the funds available for conservation management. Thus, decision makers need to strategically allocate funding for surveying sites and managing them for conservation---this is not a trivial task.
-The _surveyvoi R_ package is a decision support tool for prioritizing sites for ecological surveys based on their potential to improve plans for conserving biodiversity (e.g. plans for establishing protected areas). Given a set of sites that could potentially be acquired for conservation management -- wherein some sites have previously been surveyed and other sites have not -- it can be used to generate and evaluate plans for additional surveys. Specifically, plans for ecological surveys can be generated using various conventional approaches (e.g. maximizing expected species richness, geographic coverage, diversity of sampled environmental conditions) and directly maximizing value of information using optimization algorithms. After generating plans for surveys, they can also be evaluated using value of information analysis. Please note that several functions depend on the 'Gurobi' optimization software (available from evd_opt ) and the _gurobi R_ package (installation instructions available for [Linux](https://www.gurobi.com/documentation/9.1/quickstart_linux/r_ins_the_r_package.html), [Windows](https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html), and [Mac OS](https://www.gurobi.com/documentation/9.1/quickstart_mac/r_ins_the_r_package.html)).
+The _surveyvoi R_ package is a decision support tool for prioritizing sites for ecological surveys based on their potential to improve plans for conserving biodiversity (e.g. plans for establishing protected areas). Given a set of sites that could potentially be acquired for conservation management -- wherein some sites have previously been surveyed and other sites have not -- it can be used to generate and evaluate plans for additional surveys. Specifically, plans for ecological surveys can be generated using various conventional approaches (e.g. maximizing expected species richness, geographic coverage, diversity of sampled environmental conditions) and directly maximizing value of information using optimization algorithms. After generating plans for surveys, they can also be evaluated using value of information analysis. Please note that several functions depend on the 'Gurobi' optimization software (available from ) and the _gurobi R_ package ([installation instructions available for online Linux, Windows, and Mac OS](https://support.gurobi.com/hc/en-us/articles/4534161999889-How-do-I-install-Gurobi-Optimizer)).
This tutorial provides a brief overview of the _surveyvoi R_ package. Here, we will simulate survey data, fit statistical models to characterize the spatial distribution of a simulated species, and generate and evaluate survey schemes based on different approaches. Although this tutorial deals with only a single simulated species -- to keep the tutorial simple and reduce computational burden -- the functions used in this tutorial are designed to work with multiple species. If you want to learn more about a specific function, please consult the documentation written specifically for the function (accessible using the R code `?function`, where `function` is the name of desired function).