diff --git a/.Rbuildignore b/.Rbuildignore index e930762a..dd9b68f1 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -51,6 +51,7 @@ frc-data-birds-part-5.Rout frc-data-birds-part-6.Rout frc-data-mammals.Rout frc-data-reptiles.Rout +iucn-species-list.csv ^aoh.R$ ^customization.R$ codecov.yml diff --git a/.gitignore b/.gitignore index 93889de6..f57f4d8c 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ frc-data-birds-part-5.Rout frc-data-birds-part-6.Rout frc-data-mammals.Rout frc-data-reptiles.Rout +iucn-species-list.csv # system files .directory diff --git a/DESCRIPTION b/DESCRIPTION index 0f5e88b1..7cb50019 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: aoh Type: Package -Version: 0.0.2.13 +Version: 0.0.2.14 Title: Create Area of Habitat Data Description: Create Area of Habitat data to characterize species distributions. Data are produced following procedures outlined by Brooks et al. (2019) @@ -73,7 +73,7 @@ SystemRequirements: GDAL (>= 3.0.2) (optional), PROJ (>= 7.2.0) (optional) URL: https://prioritizr.github.io/aoh/, https://github.com/prioritizr/aoh BugReports: https://github.com/prioritizr/aoh/issues VignetteBuilder: knitr -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Collate: 'internal.R' 'calc_spp_frc_data.R' diff --git a/Makefile b/Makefile index 25f3c31b..37bc639a 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,9 @@ prep_lumbierres_habitat_data: inst/scripts/lumbierres-habitat-data.R R CMD BATCH --no-restore --no-save inst/scripts/lumbierres-habitat-data.R # process aoh data -aoh_global_data: aoh_amphibians aoh_mammals aoh_reptiles aoh_birds +aoh_global_data: aoh_amphibians aoh_mammals aoh_reptiles aoh_birds aoh_mammals + +aoh_mammals: aoh_mammals_land aoh_mammals_land_freshwater aoh_mammals_land_marine aoh_amphibians: R CMD BATCH --no-restore --no-save '--args amphibians' inst/scripts/aoh-data.R aoh-data-amphibians.Rout @@ -51,8 +53,14 @@ aoh_birds: R CMD BATCH --no-restore --no-save '--args birds-part-5' inst/scripts/aoh-data.R aoh-data-birds-part-5.Rout R CMD BATCH --no-restore --no-save '--args birds-part-6' inst/scripts/aoh-data.R aoh-data-birds-part-6.Rout -aoh_mammals: - R CMD BATCH --no-restore --no-save '--args mammals' inst/scripts/aoh-data.R aoh-data-mammals.Rout +aoh_mammals_land: + R CMD BATCH --no-restore --no-save '--args mammals-land' inst/scripts/aoh-data.R aoh-data-mammals-land.Rout + +aoh_mammals_land_freshwater: + R CMD BATCH --no-restore --no-save '--args mammals-land-freshwater' inst/scripts/aoh-data.R aoh-data-mammals-land-freshwater.Rout + +aoh_mammals_land_marine: + R CMD BATCH --no-restore --no-save '--args mammals-land-marine' inst/scripts/aoh-data.R aoh-data-mammals-land-marine.Rout aoh_reptiles: R CMD BATCH --no-restore --no-save '--args reptiles' inst/scripts/aoh-data.R aoh-data-reptiles.Rout @@ -132,4 +140,4 @@ purl_vigns: R --slave -e "lapply(dir('vignettes', '^.*\\\\.Rmd$$'), function(x) knitr::purl(file.path('vignettes', x), gsub('.Rmd', '.R', x, fixed = TRUE)))" rm -f Rplots.pdf -.PHONY: initc vigns clean data docs readme site test check checkwb build purl_vigns install man spellcheck examples prep_habitat_data prep_elevation_data aoh_reptiles aoh_mammals aoh_birds aoh_amphibians aoh_global_data frc_reptiles frc_mammals frc_birds frc_amphibians frc_global_data +.PHONY: initc vigns clean data docs readme site test check checkwb build purl_vigns install man spellcheck examples prep_habitat_data prep_elevation_data aoh_reptiles aoh_mammals aoh_mammals_land aoh_mammals_land_freshwater aoh_mammals_land_marine aoh_birds aoh_amphibians aoh_global_data frc_reptiles frc_mammals frc_birds frc_amphibians frc_global_data diff --git a/NEWS.md b/NEWS.md index a12af42e..6e6b7280 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,14 @@ +# aoh 0.0.2.14 + +- Update `create_spp_info_data()` to make data cleaning functionality more + robust for the BirdLife species' range dataset. +- Update built-in helper script for processing area of habitat data to + include (i) mammal speices with terrestrial and freshwater distributions and + (ii) mammal speices with terrestrial and marine distributions + (see `inst/scripts/aoh-data.R`) +- New built-in helper script to download all species identifiers from the + IUCN Red List (see `inst/scripts/iucn-species-list.R`) + # aoh 0.0.2.13 - Update `read_spp_range_data()` and `create_spp_info_data()` to fix diff --git a/R/clean_spp_range_data.R b/R/clean_spp_range_data.R index 47c46507..ac8316fa 100644 --- a/R/clean_spp_range_data.R +++ b/R/clean_spp_range_data.R @@ -402,9 +402,11 @@ clean_spp_range_data <- function(x, # step 6: convert MULTISURFACE to MULTIPOLYGON x <- sf::st_set_precision(x, geometry_precision) idx <- which(vapply(sf::st_geometry(x), inherits, logical(1), "MULTISURFACE")) - if (length(idx) > 0) { # nocov start + # nocov start + if (length(idx) > 0) { g <- sf::st_geometry(x) - g2 <- lapply(g[idx], sf::st_cast, "MULTIPOLYGON") + g2 <- g[idx] + g2 <- lapply(g2, sf::st_cast, "MULTIPOLYGON") g2 <- lapply(g2, sf::st_buffer, 0) g2 <- lapply(g2, sf::st_make_valid) for (i in seq_along(idx)) { @@ -412,9 +414,14 @@ clean_spp_range_data <- function(x, } x <- sf::st_set_geometry(x, g) rm(g, g2) - } # nocov end + } + # nocov end + + # force construction of object, this seems to be needed for some reason + # that I do not understand, otherwise st_collection_extract() throws + # an error + x <- x[seq_len(nrow(x)), , drop = FALSE] x <- suppressWarnings(sf::st_collection_extract(x, "POLYGON")) - invisible(gc()) # step 7: fix any potential geometry issues x <- st_repair_geometry(x, geometry_precision) @@ -422,8 +429,11 @@ clean_spp_range_data <- function(x, # step 8: wrap geometries to dateline x <- sf::st_set_precision(x, geometry_precision) - x <- suppressWarnings(sf::st_wrap_dateline(x, - options = c("WRAPDATELINE=YES", "DATELINEOFFSET=180")) + x <- suppressWarnings( + sf::st_wrap_dateline( + x, + options = c("WRAPDATELINE=YES", "DATELINEOFFSET=180") + ) ) invisible(gc()) diff --git a/R/st_repair_geometry.R b/R/st_repair_geometry.R index eb7e48f0..4613fcff 100644 --- a/R/st_repair_geometry.R +++ b/R/st_repair_geometry.R @@ -153,7 +153,7 @@ st_repair_geometry <- function(x, geometry_precision = 1e5) { requireNamespace("prepr", quietly = TRUE), msg = paste( "the \"prepr\" package needs to be installed, use: \n", - "remotes::install_github(\"dickoa/prepr\")" + "remotes::install_github(\"prioritizr/prepr\")" ) ) ### find geometries to repair diff --git a/README.md b/README.md index 41ac4f19..d88c4d36 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,7 @@ produce Area of Habitat data. relevant data using: Hanson JO (2024) aoh: Create Area of Habitat Data. R package version - 0.0.2.12. Available at https://github.com/prioritizr/aoh. + 0.0.2.14. Available at https://github.com/prioritizr/aoh. IUCN [insert year] IUCN Red List of Threatened Species. Version [insert version]. Available at www.iucnredlist.org. diff --git a/docs/404.html b/docs/404.html index f440a131..c7bb1e6a 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,7 +6,7 @@ Page not found (404) • aoh - + @@ -18,7 +18,7 @@ - +
@@ -47,7 +47,7 @@
- +
@@ -103,16 +103,16 @@

Page not found (404)

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/articles/aoh.html b/docs/articles/aoh.html index 9d0716d7..d28eb737 100644 --- a/docs/articles/aoh.html +++ b/docs/articles/aoh.html @@ -6,20 +6,19 @@ Getting started • aoh - + - - +
@@ -48,7 +47,7 @@
- +
+
@@ -424,16 +421,16 @@

References

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/articles/aoh_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/aoh_files/figure-html/unnamed-chunk-10-1.png index 94041e02..b9d89ea4 100644 Binary files a/docs/articles/aoh_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/aoh_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/docs/articles/customization.html b/docs/articles/customization.html index 2225af28..647d1578 100644 --- a/docs/articles/customization.html +++ b/docs/articles/customization.html @@ -6,20 +6,19 @@ Customization • aoh - + - - +
@@ -48,7 +47,7 @@
- +
+
@@ -700,16 +697,16 @@

References

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-10-1.png index 6265890b..c01d8a4d 100644 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/customization_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-15-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-15-1.png deleted file mode 100644 index 49dde89d..00000000 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-15-1.png and /dev/null differ diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-16-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-16-1.png deleted file mode 100644 index 49dde89d..00000000 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-16-1.png and /dev/null differ diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-17-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-17-1.png index 49dde89d..b411224b 100644 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-17-1.png and b/docs/articles/customization_files/figure-html/unnamed-chunk-17-1.png differ diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-3-1.png deleted file mode 100644 index 0f4efa8c..00000000 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-3-1.png and /dev/null differ diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-4-1.png index 0f4efa8c..e6a567b9 100644 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/customization_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-7-1.png deleted file mode 100644 index 4ba7c8c4..00000000 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-7-1.png and /dev/null differ diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-8-1.png deleted file mode 100644 index 4ba7c8c4..00000000 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-8-1.png and /dev/null differ diff --git a/docs/articles/customization_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/customization_files/figure-html/unnamed-chunk-9-1.png index 4ba7c8c4..2cf28c05 100644 Binary files a/docs/articles/customization_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/customization_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index 0e8c8993..8e9dd1a2 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,9 +1,9 @@ -Articles • aohArticles • aoh - +
@@ -31,7 +31,7 @@
- +
@@ -77,15 +77,15 @@

All vignettes

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/authors.html b/docs/authors.html index db12ed05..d2de0c2b 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,9 +1,9 @@ -Authors and Citation • aohAuthors and Citation • aoh - +
@@ -31,7 +31,7 @@
- +
- +
-

Hanson JO (2024) aoh: Create Area of Habitat Data. R package version 0.0.2.12. Available at https://github.com/prioritizr/aoh.

+

Hanson JO (2024) aoh: Create Area of Habitat Data. R package version 0.0.2.14. Available at https://github.com/prioritizr/aoh.

@Manual{,
   author = {Jeffrey O Hanson},
   title = {aoh: Create Area of Habitat Data},
   year = {2024},
-  note = {R package version 0.0.2.12},
+  note = {R package version 0.0.2.14},
   url = {https://github.com/prioritizr/aoh},
 }

IUCN [insert year] IUCN Red List of Threatened Species. Version [insert version]. Available at www.iucnredlist.org.

@@ -101,7 +101,7 @@

Citation

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, Visconti P (2020). “A global map of terrestrial habitat types.” Scientific Data, 7(1), 256. -doi:10.1038/s41597-020-00599-8. +doi:10.1038/s41597-020-00599-8.

@Article{,
   author = {Martin Jung and Prabhat Raj Dahal and Stuart H. M. Butchart and Paul F. Donald and Xavier {De Lamo} and Myroslava Lesiv and Valerie Kapos and Carlo Rondinini and Piero Visconti},
@@ -124,7 +124,7 @@ 

Citation

Lumbierres M, Dahal PR, Di Marco M, Butchart SHM, Donald PF, Rondinini C (2021). “Translating habitat class to land cover to map area of habitat of terrestrial vertebrates.” Conservation Biology, 36(3), e13851. -doi:10.1111/cobi.13851. +doi:10.1111/cobi.13851.

@Article{,
   author = {Maria Lumbierres and Prabhat Raj Dahal and Moreno {Di Marco} and Stuart H. M. Butchart and Paul F. Donald and Carlo Rondinini},
@@ -139,7 +139,7 @@ 

Citation

Robinson N, Regetz J, Guralnick RP (2014). “EarthEnv-DEM90: A nearly-global, void-free, multi-scale smoothed 90m digital elevation model from fused ASTER and SRTM data.” ISPRS Journal of Photogrammetry and Remote Sensing, 87(1), 57–67. -doi:10.1016/j.isprsjprs.2013.11.002. +doi:10.1016/j.isprsjprs.2013.11.002.

@Article{,
   author = {Natalie Robinson and James Regetz and Robert P Guralnick},
@@ -163,15 +163,15 @@ 

Citation

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/index.html b/docs/index.html index 28ef0423..b82acdee 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,33 +6,20 @@ Create Area of Habitat Data • aoh - + - + - +
@@ -61,7 +48,7 @@
- +
@@ -321,7 +308,7 @@

Citationrelevant data using: Hanson JO (2024) aoh: Create Area of Habitat Data. R package version - 0.0.2.12. Available at https://github.com/prioritizr/aoh. + 0.0.2.14. Available at https://github.com/prioritizr/aoh. IUCN [insert year] IUCN Red List of Threatened Species. Version [insert version]. Available at www.iucnredlist.org. @@ -413,16 +400,16 @@

Developers

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/news/index.html b/docs/news/index.html index 0060d65c..3f49f42a 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,9 +1,9 @@ -Changelog • aohChangelog • aoh - +
@@ -31,7 +31,7 @@
- +
@@ -60,6 +60,17 @@

Changelog

Source: NEWS.md
+
+ +
  • Update create_spp_info_data() to make data cleaning functionality more robust for the BirdLife species’ range dataset.
  • +
  • Update built-in helper script for processing area of habitat data to include (i) mammal speices with terrestrial and freshwater distributions and
    1. mammal speices with terrestrial and marine distributions (see inst/scripts/aoh-data.R)
  • +
  • New built-in helper script to download all species identifiers from the IUCN Red List (see inst/scripts/iucn-species-list.R)
  • +
+
+ +
  • Fix bug in create_spp_info_data() in assigning habitat types for resident distributions of migratory and non-migratory species. This bug meant that (i) habitat types for resident distributions of migratory species would include those exclusively affiliated with the species’ passage distributions and (ii) habitat types for resident distributions of non-migratory species would not include those exclusively affiliated with the species’ passage distributions. Thanks to Jianqiao Zhao for bug report.
  • @@ -183,15 +194,15 @@
-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index b8b1f611..5db15196 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,8 +1,7 @@ pandoc: '2.13' -pkgdown: 2.0.7 +pkgdown: 2.1.0 pkgdown_sha: ~ articles: aoh: aoh.html customization: customization.html -last_built: 2024-07-24T04:29Z - +last_built: 2024-08-04T19:48Z diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png index 89f43515..9563d426 100644 Binary files a/docs/reference/Rplot001.png and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png index 9e6ed8d4..53749bdd 100644 Binary files a/docs/reference/Rplot002.png and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/Rplot003.png b/docs/reference/Rplot003.png index f91f3c5f..191ec1c4 100644 Binary files a/docs/reference/Rplot003.png and b/docs/reference/Rplot003.png differ diff --git a/docs/reference/aoh.html b/docs/reference/aoh.html index cbaba1b2..5ca71a5b 100644 --- a/docs/reference/aoh.html +++ b/docs/reference/aoh.html @@ -1,5 +1,5 @@ -aoh: Create Area of Habitat Data — aoh • aohaoh: Create Area of Habitat Data — aoh • aoh - +
@@ -54,7 +54,7 @@
- +
@@ -114,7 +114,7 @@

aoh: Create Area of Habitat Data

Accessing the IUCN Red List API

- +

You will need to obtain a token for the @@ -129,8 +129,8 @@

Accessing the IUCN Red List API

the token) and save the file:

IUCN_REDLIST_KEY="your_actual_token_not_this_string"

Please restart your R session. You should now be able to access the IUCN Red -List API. To verify this, please try running the following R code and -- -assuming everything works correctly -- you should see TRUE as the output:

+List API. To verify this, please try running the following R code and – +assuming everything works correctly – you should see TRUE as the output:

# verify access to IUCN Red List API
 is_iucn_rl_available()

If these instructions did not work, please consult the documentation for the @@ -142,10 +142,10 @@

References

Hilton-Taylor C, Hoffmann M, Jenkins CN, Joppa L, Li BV, Menon V, Ocampo-Peñuela N, Rondinini C (2019) Measuring terrestrial Area of Habitat (AOH) and its utility for the IUCN Red List. Trends in Ecology & Evolution, -34, 977--986. doi:10.1016/j.tree.2019.06.009

+34, 977–986. doi:10.1016/j.tree.2019.06.009

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020a) A global map of -terrestrial habitat types. Scientific data, 7, 1--8. +terrestrial habitat types. Scientific data, 7, 1–8. doi:10.1038/s41597-020-00599-8

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020b) A global map of @@ -159,16 +159,16 @@

References

Robinson N, Regetz J, and Guralnick RP (2014) EarthEnv-DEM90: A nearly- global, void-free, multi-scale smoothed, 90m digital elevation model from fused ASTER and SRTM data. -ISPRS Journal of Photogrammetry and Remote Sensing, 87:57--67. +ISPRS Journal of Photogrammetry and Remote Sensing, 87:57–67. doi:10.1016/j.isprsjprs.2013.11.002

Rondinini C, Stuart S, Boitani L (2005) Habitat suitability models and the shortfall in conservation planning for African vertebrates. -Conservation Biology, 19, 1488--1497. +Conservation Biology, 19, 1488–1497. doi:10.1111/j.1523-1739.2005.00204

Tracewski Ł, Butchart SHM, Di Marco M, Ficetola GF, Rondinini C, Symes A, Wheatley H, Beresford AE, Buchanan GM (2016) Toward quantification of the impact of 21st‐century deforestation on the extinction risk of terrestrial -vertebrates. Conservation Biology, 30, 1070--1079. +vertebrates. Conservation Biology, 30, 1070–1079. doi:10.1111/cobi.12715

@@ -195,15 +195,15 @@

Author

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/calc_spp_frc_data-1.png b/docs/reference/calc_spp_frc_data-1.png index c1cc4b5d..1212236a 100644 Binary files a/docs/reference/calc_spp_frc_data-1.png and b/docs/reference/calc_spp_frc_data-1.png differ diff --git a/docs/reference/calc_spp_frc_data.html b/docs/reference/calc_spp_frc_data.html index c436f8a2..0ff693c9 100644 --- a/docs/reference/calc_spp_frc_data.html +++ b/docs/reference/calc_spp_frc_data.html @@ -1,9 +1,9 @@ -Calculate fractional coverage data — calc_spp_frc_data • aohCalculate fractional coverage data — calc_spp_frc_data • aoh - +
@@ -31,7 +31,7 @@
- +
@@ -83,13 +83,15 @@

Calculate fractional coverage data

Arguments

-
x
+ + +
x

sf::st_sf() Object containing the species data. This object should be produced using the create_spp_aoh_data() function.

-
res
+
res

numeric Resolution for computing fractional coverage. Note that the argument to res must be a factor of the the resolution of the underlying Area of Habitat data. @@ -97,12 +99,12 @@

Arguments

if the underlying data had a resolution of 100 m.

-
output_dir
+
output_dir

character character Folder path to save raster (GeoTIFF) files containing the fractional coverage data.

-
template_data
+
template_data

terra::rast() Raster data to use as a template for computing fractional coverage. Note that the argument should have the same spatial properties @@ -113,20 +115,20 @@

Arguments

get_lumb_cgls_habitat_data()).

-
cache_dir
+
cache_dir

character Folder path for downloading and caching data. By default, a temporary directory is used (i.e., tempdir()). To avoid downloading the same data multiple times, it is strongly recommended to specify a persistent storage location (see Examples below).

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
n_threads
+
n_threads

integer Number of computational threads to use for data processing. To reduce run time, it is strongly recommended to set this @@ -138,14 +140,14 @@

Arguments

Defaults to 1.

-
engine
+
engine

character Value indicating the name of the software to use for data processing. Available options include "terra" or "gdal". Defaults to "terra".

-
cache_limit
+
cache_limit

integer Amount of memory (Mb) for caching when processing spatial data with the Geospatial Data Abstraction Library (GDAL). @@ -156,20 +158,18 @@

Arguments

Defaults to 1000.

-
verbose
+
verbose

logical Should progress be displayed while processing data? Defaults to TRUE.

-
...
+
...

Arguments passed to get_lumb_cgls_habitat_data().

Value

- - -

An updated version of the argument to x with updated values +

An updated version of the argument to x with updated values for the path, xmin, xmax, ymin, and ymax columns. The

@@ -184,7 +184,7 @@

Details

Output file format

- +

Fractional coverage data are stored in a separate raster (GeoTIFF) file for each seasonal distribution of each species. Each raster file is assigned a @@ -240,19 +240,19 @@

Examples

#> initializing [1.4s] #> #> cleaning species range data -#> cleaning species range data [1.9s] +#> cleaning species range data [1.7s] #> #> importing species summary data -#> importing species summary data [468ms] +#> importing species summary data [447ms] #> #> importing species habitat data -#> importing species habitat data [343ms] +#> importing species habitat data [337ms] #> #> collating species data -#> collating species data [171ms] +#> collating species data [144ms] #> #> post-processing results -#> post-processing results [11ms] +#> post-processing results [10ms] #> #> finished @@ -264,7 +264,7 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [5ms] +#> initializing [4ms] #> #> importing global elevation data #> importing global elevation data [7.1s] @@ -272,19 +272,19 @@

Examples

#> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [5.3s] +#> importing global habitat data [5.7s] #> #> generating Area of Habitat data -#> processing ■■■■■■■■■ [ 25% | ETA: 11s] +#> processing ■■■■■■■■■ [ 25% | ETA: 10s] #> processing ■■■■■■■■■■■■■■■■ [ 50% | ETA: 7s] -#> processing ■■■■■■■■■■■■■■■■■■■■■■■ [ 75% | ETA: 5s] -#> processing [22.7s] +#> processing ■■■■■■■■■■■■■■■■■■■■■■■ [ 75% | ETA: 4s] +#> processing [21.3s] #> #> generating Area of Habitat data -#> generating Area of Habitat data [22.7s] +#> generating Area of Habitat data [21.4s] #> #> post-processing results -#> post-processing results [11ms] +#> post-processing results [10ms] #> #> finished @@ -296,7 +296,7 @@

Examples

cache_dir = cache_dir ) #> importing global habitat data -#> importing global habitat data [5.5s] +#> importing global habitat data [6.3s] #> # } @@ -325,15 +325,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/create_spp_aoh_data-1.png b/docs/reference/create_spp_aoh_data-1.png index 54d734bc..0e643f76 100644 Binary files a/docs/reference/create_spp_aoh_data-1.png and b/docs/reference/create_spp_aoh_data-1.png differ diff --git a/docs/reference/create_spp_aoh_data.html b/docs/reference/create_spp_aoh_data.html index 20ecf9a2..87a40157 100644 --- a/docs/reference/create_spp_aoh_data.html +++ b/docs/reference/create_spp_aoh_data.html @@ -1,5 +1,5 @@ -Create Area of Habitat data — create_spp_aoh_data • aohCreate Area of Habitat data — create_spp_aoh_data • aoh - +
@@ -36,7 +36,7 @@
- +
@@ -96,18 +96,20 @@

Create Area of Habitat data

Arguments

-
x
+ + +
x

sf::sf() Spatial data delineating species' geographic ranges, habitat preferences, and elevational limits. This object should be created using the create_spp_info_data() function.

-
output_dir
+
output_dir

character Folder path to save raster (GeoTIFF) files containing the Area of Habitat data.

-
elevation_data
+
elevation_data

terra::rast() Raster data delineating the worldwide elevation data (e.g., Robinson et al. 2014). Defaults to NULL such that data @@ -116,7 +118,7 @@

Arguments

of the habitat data will be used to reduce processing time.

-
habitat_data
+
habitat_data

terra::rast() Raster data indicating the presence of different habitat classes across world (e.g., Jung et al. 2020a,b; Lumbierres et al. 2021). @@ -127,7 +129,7 @@

Arguments

get_lumb_cgls_habitat_data()).

-
crosswalk_data
+
crosswalk_data

data.frame() Table containing data that indicate which grid cell values in the argument to habitat_data correspond to which IUCN habitat classification codes. The argument should contain @@ -138,14 +140,14 @@

Arguments

data are used (i.e., crosswalk_lumb_cgls_data()).

-
cache_dir
+
cache_dir

character Folder path for downloading and caching data. By default, a temporary directory is used (i.e., tempdir()). To avoid downloading the same data multiple times, it is strongly recommended to specify a persistent storage location (see Examples below).

-
habitat_version
+
habitat_version

character Version of the habitat dataset that should be used. See documentation for the the version parameter in the get_lumb_cgls_habitat_data() function @@ -156,7 +158,7 @@

Arguments

used if data need to be obtained.

-
elevation_version
+
elevation_version

character Version of the elevation dataset that should be used. See documentation for the the version parameter in the get_global_elevation_data() function @@ -167,13 +169,13 @@

Arguments

used if data need to be obtained.

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
n_threads
+
n_threads

integer Number of computational threads to use for data processing. To reduce run time, it is strongly recommended to set this @@ -185,7 +187,7 @@

Arguments

Defaults to 1.

-
cache_limit
+
cache_limit

integer Amount of memory (Mb) for caching when processing spatial data with the Geospatial Data Abstraction Library (GDAL). @@ -196,7 +198,7 @@

Arguments

Defaults to 1000.

-
engine
+
engine

character Value indicating the name of the software to use for data processing. Available options include "terra", "gdal", or "grass" @@ -204,7 +206,7 @@

Arguments

Defaults to "terra".

-
rasterize_touches
+
rasterize_touches

logical How should x (the species' range data) be rasterized when overlapped with the elevation and habitat raster data? If rasterize_touches = FALSE, the species' range data are treated as @@ -222,16 +224,14 @@

Arguments

Defaults to FALSE (following Lumbierres et al. 2022).

-
verbose
+
verbose

logical Should progress be displayed while processing data? Defaults to TRUE.

Value

- - -

A sf::st_sf() object. This object is an updated version +

A sf::st_sf() object. This object is an updated version of the argument to x, and contains additional columns describing the output raster files. Specifically, it contains the following columns:

id_no

numeric species' taxon identifier on the IUCN Red List.

@@ -304,7 +304,7 @@

Value

Engines

- +

This function can use different software engines for data processing (specified via argument to engine). Although each engine produces the @@ -324,7 +324,7 @@

Engines

Data processing

- +

The Area of Habitat data are produced using the following procedures. After these data are generated, they stored as files on disk @@ -337,7 +337,7 @@

Data processing

Output file format

- +

Area of Habitat data are stored in a separate raster (GeoTIFF) file for each seasonal distribution of each species. Each raster file is assigned a file @@ -357,10 +357,10 @@

References

Hilton-Taylor C, Hoffmann M, Jenkins CN, Joppa L, Li BV, Menon V, Ocampo-Peñuela N, Rondinini C (2019) Measuring terrestrial Area of Habitat (AOH) and its utility for the IUCN Red List. Trends in Ecology & Evolution, -34, 977--986. doi:10.1016/j.tree.2019.06.009

+34, 977–986. doi:10.1016/j.tree.2019.06.009

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020a) A global map of -terrestrial habitat types. Scientific Data, 7, 1--8. +terrestrial habitat types. Scientific Data, 7, 1–8. doi:10.1038/s41597-020-00599-8

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020b) A global map of @@ -377,7 +377,7 @@

References

Robinson N, Regetz J, and Guralnick RP (2014) EarthEnv-DEM90: A nearly- global, void-free, multi-scale smoothed, 90m digital elevation model from fused ASTER and SRTM data. -ISPRS Journal of Photogrammetry and Remote Sensing, 87, 57--67. +ISPRS Journal of Photogrammetry and Remote Sensing, 87, 57–67. doi:10.1016/j.isprsjprs.2013.11.002

@@ -411,19 +411,19 @@

Examples

#> initializing [346ms] #> #> cleaning species range data -#> cleaning species range data [3s] +#> cleaning species range data [2.9s] #> #> importing species summary data -#> importing species summary data [351ms] +#> importing species summary data [339ms] #> #> importing species habitat data -#> importing species habitat data [342ms] +#> importing species habitat data [333ms] #> #> collating species data -#> collating species data [204ms] +#> collating species data [203ms] #> #> post-processing results -#> post-processing results [10ms] +#> post-processing results [11ms] #> #> finished @@ -439,16 +439,16 @@

Examples

#> initializing [4ms] #> #> importing global elevation data -#> importing global elevation data [7.2s] +#> importing global elevation data [7.4s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [5.3s] +#> importing global habitat data [5.2s] #> #> generating Area of Habitat data #> skipping 4 species distributions already processed -#> generating Area of Habitat data [32ms] +#> generating Area of Habitat data [31ms] #> #> post-processing results #> post-processing results [11ms] @@ -531,15 +531,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/create_spp_frc_data-1.png b/docs/reference/create_spp_frc_data-1.png index c1cc4b5d..1212236a 100644 Binary files a/docs/reference/create_spp_frc_data-1.png and b/docs/reference/create_spp_frc_data-1.png differ diff --git a/docs/reference/create_spp_frc_data.html b/docs/reference/create_spp_frc_data.html index db4208e0..55ad9b9d 100644 --- a/docs/reference/create_spp_frc_data.html +++ b/docs/reference/create_spp_frc_data.html @@ -1,5 +1,5 @@ -Create fractional coverage data — create_spp_frc_data • aohCreate fractional coverage data — create_spp_frc_data • aoh - +
@@ -40,7 +40,7 @@
- +
@@ -105,18 +105,20 @@

Create fractional coverage data

Arguments

-
x
+ + +
x

sf::sf() Spatial data delineating species' geographic ranges, habitat preferences, and elevational limits. This object should be created using the create_spp_info_data() function.

-
output_dir
+
output_dir

character Folder path to save raster (GeoTIFF) files containing the fractional coverage data.

-
res
+
res

numeric Resolution for computing fractional coverage. Note that the argument to res must be a factor of the the resolution of the underlying Area of Habitat data. @@ -124,7 +126,7 @@

Arguments

if the underlying data had a resolution of 100 m.

-
elevation_data
+
elevation_data

terra::rast() Raster data delineating the worldwide elevation data (e.g., Robinson et al. 2014). Defaults to NULL such that data @@ -133,7 +135,7 @@

Arguments

of the habitat data will be used to reduce processing time.

-
habitat_data
+
habitat_data

terra::rast() Raster data indicating the presence of different habitat classes across world (e.g., Jung et al. 2020a,b; Lumbierres et al. 2021). @@ -144,7 +146,7 @@

Arguments

get_lumb_cgls_habitat_data()).

-
crosswalk_data
+
crosswalk_data

data.frame() Table containing data that indicate which grid cell values in the argument to habitat_data correspond to which IUCN habitat classification codes. The argument should contain @@ -155,14 +157,14 @@

Arguments

data are used (i.e., crosswalk_lumb_cgls_data()).

-
cache_dir
+
cache_dir

character Folder path for downloading and caching data. By default, a temporary directory is used (i.e., tempdir()). To avoid downloading the same data multiple times, it is strongly recommended to specify a persistent storage location (see Examples below).

-
habitat_version
+
habitat_version

character Version of the habitat dataset that should be used. See documentation for the the version parameter in the get_lumb_cgls_habitat_data() function @@ -173,7 +175,7 @@

Arguments

used if data need to be obtained.

-
elevation_version
+
elevation_version

character Version of the elevation dataset that should be used. See documentation for the the version parameter in the get_global_elevation_data() function @@ -184,13 +186,13 @@

Arguments

used if data need to be obtained.

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
n_threads
+
n_threads

integer Number of computational threads to use for data processing. To reduce run time, it is strongly recommended to set this @@ -202,7 +204,7 @@

Arguments

Defaults to 1.

-
cache_limit
+
cache_limit

integer Amount of memory (Mb) for caching when processing spatial data with the Geospatial Data Abstraction Library (GDAL). @@ -213,7 +215,7 @@

Arguments

Defaults to 1000.

-
engine
+
engine

character Value indicating the name of the software to use for data processing. Available options include "terra", "gdal", or "grass" @@ -221,7 +223,7 @@

Arguments

Defaults to "terra".

-
rasterize_touches
+
rasterize_touches

logical How should x (the species' range data) be rasterized when overlapped with the elevation and habitat raster data? If rasterize_touches = FALSE, the species' range data are treated as @@ -239,16 +241,14 @@

Arguments

Defaults to FALSE (following Lumbierres et al. 2022).

-
verbose
+
verbose

logical Should progress be displayed while processing data? Defaults to TRUE.

Value

- - -

A sf::st_sf() object. This object is an updated version +

A sf::st_sf() object. This object is an updated version of the argument to x, and contains additional columns describing the output raster files. Specifically, it contains the following columns:

id_no

numeric species' taxon identifier on the IUCN Red List.

@@ -321,7 +321,7 @@

Value

Data processing

- +

The fractional coverage data generated using the following procedures. After these data are generated, they stored as files on disk @@ -344,7 +344,7 @@

Data processing

Output file format

- +

Fractional coverage data are stored in a separate raster (GeoTIFF) file for each seasonal distribution of each species. Each raster file is assigned a @@ -362,7 +362,7 @@

Output file format

Engines

- +

This function can use different software engines for data processing (specified via argument to engine). Although each engine produces the @@ -386,10 +386,10 @@

References

Hilton-Taylor C, Hoffmann M, Jenkins CN, Joppa L, Li BV, Menon V, Ocampo-Peñuela N, Rondinini C (2019) Measuring terrestrial Area of Habitat (AOH) and its utility for the IUCN Red List. Trends in Ecology & Evolution, -34, 977--986. doi:10.1016/j.tree.2019.06.009

+34, 977–986. doi:10.1016/j.tree.2019.06.009

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020a) A global map of -terrestrial habitat types. Scientific Data, 7, 1--8. +terrestrial habitat types. Scientific Data, 7, 1–8. doi:10.1038/s41597-020-00599-8

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020b) A global map of @@ -406,7 +406,7 @@

References

Robinson N, Regetz J, and Guralnick RP (2014) EarthEnv-DEM90: A nearly- global, void-free, multi-scale smoothed, 90m digital elevation model from fused ASTER and SRTM data. -ISPRS Journal of Photogrammetry and Remote Sensing, 87, 57--67. +ISPRS Journal of Photogrammetry and Remote Sensing, 87, 57–67. doi:10.1016/j.isprsjprs.2013.11.002

@@ -445,22 +445,22 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [344ms] +#> initializing [336ms] #> #> cleaning species range data -#> cleaning species range data [3s] +#> cleaning species range data [2.8s] #> #> importing species summary data -#> importing species summary data [351ms] +#> importing species summary data [340ms] #> #> importing species habitat data -#> importing species habitat data [342ms] +#> importing species habitat data [331ms] #> #> collating species data #> collating species data [205ms] #> #> post-processing results -#> post-processing results [10ms] +#> post-processing results [11ms] #> #> finished @@ -476,19 +476,19 @@

Examples

#> initializing [4ms] #> #> importing global elevation data -#> importing global elevation data [7.5s] +#> importing global elevation data [6.9s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [4.8s] +#> importing global habitat data [5.5s] #> #> generating Area of Habitat data #> skipping 4 species distributions already processed -#> generating Area of Habitat data [33ms] +#> generating Area of Habitat data [32ms] #> #> post-processing results -#> post-processing results [32ms] +#> post-processing results [31ms] #> #> finished # } @@ -568,15 +568,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/create_spp_info_data.html b/docs/reference/create_spp_info_data.html index daef657e..72298753 100644 --- a/docs/reference/create_spp_info_data.html +++ b/docs/reference/create_spp_info_data.html @@ -1,5 +1,5 @@ -Create species' information data — create_spp_info_data • aohCreate species' information data — create_spp_info_data • aoh - +
@@ -36,7 +36,7 @@
- +
@@ -98,13 +98,15 @@

Create species' information data

Arguments

-
x
+ + +
x

sf::sf() Spatial data delineating species geographic ranges obtained from the IUCN Red List. See below for details.

-
spp_summary_data
+
spp_summary_data

tibble::tibble() Table containing summary information for each species (in the argument to x). Specifically, the argument should contain the following columns: "id_no", @@ -117,7 +119,7 @@

Arguments

latest version of the IUCN Red List.

-
spp_habitat_data
+
spp_habitat_data

tibble::tibble() Table containing habitat preference information for each species (in the argument to x). Specifically, the argument should contain the following columns: "id_no", @@ -134,14 +136,14 @@

Arguments

latest version of the IUCN Red List.

-
cache_dir
+
cache_dir

character Folder path for downloading and caching data. By default, a temporary directory is used (i.e., tempdir()). To avoid downloading the same data multiple times, it is strongly recommended to specify a persistent storage location (see Examples below).

-
iucn_version
+
iucn_version

character Version of the IUCN Red List dataset that should be used. See documentation for the the version parameter in the get_spp_summary_data() function @@ -150,20 +152,20 @@

Arguments

used.

-
key
+
key

character Token for querying the IUCN Red List API. Defaults to NULL such that the token accessed from the "IUCN_REDLIST_KEY" environmental variable (which can be specified in the .Renviron file).

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
keep_iucn_rl_presence
+
keep_iucn_rl_presence

integer IUCN Red List presence codes to retain (see IUCN SSC Red List Technical Working Group 2021 for details). @@ -173,7 +175,7 @@

Arguments

(corresponding to extant and probably extant).

-
keep_iucn_rl_origin
+
keep_iucn_rl_origin

integer IUCN Red List origin codes to retain (see IUCN SSC Red List Technical Working Group 2021 for details). @@ -183,7 +185,7 @@

Arguments

(corresponding to native, reintroduced, and assisted colonization).

-
keep_iucn_rl_seasonal
+
keep_iucn_rl_seasonal

integer IUCN Red List seasonal codes to retain (see IUCN SSC Red List Technical Working Group 2021 for details). @@ -194,7 +196,7 @@

Arguments

and passage distributions).

-
omit_habitat_codes
+
omit_habitat_codes

character Habitat classification codes to omit from resulting Area of Habitat data. Please see the IUCN Red List Habitat Classification Scheme @@ -210,13 +212,13 @@

Arguments

habitats are excluded.

-
adjust_elevational_limits
+
adjust_elevational_limits

logical Should elevation limits be adjusted to correct for errors? Defaults to TRUE to automatically fix errors (see Data processing section below for details).

-
adjust_habitat_codes
+
adjust_habitat_codes

logical Should habitat codes be adjusted so they are assigned to species' distributions following guidelines for Key Biodiversity areas? @@ -227,7 +229,7 @@

Arguments

are assigned to the resident distribution).

-
crs
+
crs

A st_crs() object containing the coordinate reference system for reprojecting the species' range data. This coordinate reference system should be the same as the elevation @@ -241,7 +243,7 @@

Arguments

get_lumb_cgls_habitat_data() functions).

-
geometry_precision
+
geometry_precision

numeric level of precision for processing the spatial data (used with sf::st_set_precision()). The default is 100000 (higher values indicate higher precision). @@ -252,16 +254,14 @@

Arguments

parameter can sometimes resolve these issues.

-
verbose
+
verbose

logical Should progress be displayed while processing data? Defaults to TRUE.

Value

- - -

A sf::st_sf() object containing all the information needed +

A sf::st_sf() object containing all the information needed to create Area of Habitat data. It contains cleaned versions of the species' range maps and columns containing the species' elevational limits and habitat preferences. @@ -306,7 +306,7 @@

Value

Species range data format

- +

Species range data are expected to follow the data format conventions for the IUCN Red List (see IUCN Red List documentation for @@ -358,7 +358,7 @@

Species range data format

Data processing

- +

The species' information data are produced using the following procedures.

  1. Species range data cleaned. By default, the range data are cleaned following guidelines for the identification of Key Biodiversity Areas @@ -451,7 +451,7 @@

    References

    Hilton-Taylor C, Hoffmann M, Jenkins CN, Joppa L, Li BV, Menon V, Ocampo-Peñuela N, Rondinini C (2019) Measuring terrestrial Area of Habitat (AOH) and its utility for the IUCN Red List. Trends in Ecology & Evolution, -34, 977--986. doi:10.1016/j.tree.2019.06.009

    +34, 977–986. doi:10.1016/j.tree.2019.06.009

    KBA Standards and Appeals Committee of IUCN SSC/WCPA (2022). Guidelines for using A Global Standard for the Identification of Key Biodiversity Areas. Version 1.2. Gland, Switzerland: IUCN.

    @@ -482,13 +482,13 @@

    Examples

    cache_dir = cache_dir ) #> initializing -#> initializing [345ms] +#> initializing [337ms] #> #> cleaning species range data -#> cleaning species range data [3s] +#> cleaning species range data [2.8s] #> #> importing species summary data -#> importing species summary data [345ms] +#> importing species summary data [334ms] #> #> importing species habitat data #> importing species habitat data [343ms] @@ -522,15 +522,15 @@

    Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/crosswalk_jung_lvl1_data.html b/docs/reference/crosswalk_jung_lvl1_data.html index 40dec7cb..9674b8c8 100644 --- a/docs/reference/crosswalk_jung_lvl1_data.html +++ b/docs/reference/crosswalk_jung_lvl1_data.html @@ -1,20 +1,20 @@ -Crosswalk data for Jung et al. (2020) (level 1 classification) — crosswalk_jung_lvl1_data • aohCrosswalk data for Jung et al. (2020) (level 1 classification) — crosswalk_jung_lvl1_data • aoh - +
@@ -42,7 +42,7 @@
- +
@@ -80,8 +80,8 @@

Crosswalk data for Jung et al. (2020) (level 1 classification)

To map the spatial location of each of these habitat classes, Jung et al. (2020a) developed a global raster dataset by combining a range of different land use and land cover data (Jung et al. 2020b). -They created two habitat classification schemes -- termed level 1 and -level 2 classification schemes -- to describe coarse-scale and +They created two habitat classification schemes – termed level 1 and +level 2 classification schemes – to describe coarse-scale and fine-scale differences in habitat classes. This dataset provides a crosswalk table to associate the values in the level 1 raster dataset with IUCN habitat classes.

@@ -115,7 +115,7 @@

Source

References

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020a) A global map of -terrestrial habitat types. Scientific Data, 7, 1--8. +terrestrial habitat types. Scientific Data, 7, 1–8. doi:10.1038/s41597-020-00599-8

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020b) A global map of @@ -164,15 +164,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/crosswalk_jung_lvl2_data.html b/docs/reference/crosswalk_jung_lvl2_data.html index 65c121fa..66e4ea14 100644 --- a/docs/reference/crosswalk_jung_lvl2_data.html +++ b/docs/reference/crosswalk_jung_lvl2_data.html @@ -1,20 +1,20 @@ -Crosswalk data for Jung et al. (2020) (level 2 classification) — crosswalk_jung_lvl2_data • aohCrosswalk data for Jung et al. (2020) (level 2 classification) — crosswalk_jung_lvl2_data • aoh - +
@@ -42,7 +42,7 @@
- +
@@ -80,8 +80,8 @@

Crosswalk data for Jung et al. (2020) (level 2 classification)

To map the spatial location of each of these habitat classes, Jung et al. (2020a) developed a global raster dataset by combining a range of different land use and land cover data (Jung et al. 2020b). -They created two habitat classification schemes -- termed level 1 and -level 2 classification schemes -- to describe coarse-scale and +They created two habitat classification schemes – termed level 1 and +level 2 classification schemes – to describe coarse-scale and fine-scale differences in habitat classes. This dataset provides a crosswalk table to associate the values in the level 2 raster dataset with IUCN habitat classes.

@@ -115,7 +115,7 @@

Source

References

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020a) A global map of -terrestrial habitat types. Scientific Data, 7, 1--8. +terrestrial habitat types. Scientific Data, 7, 1–8. doi:10.1038/s41597-020-00599-8

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020b) A global map of @@ -164,15 +164,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/crosswalk_jung_plvl1_data.html b/docs/reference/crosswalk_jung_plvl1_data.html index 8cd35a21..39c76541 100644 --- a/docs/reference/crosswalk_jung_plvl1_data.html +++ b/docs/reference/crosswalk_jung_plvl1_data.html @@ -1,5 +1,5 @@ -Crosswalk data for Jung (2020) potential habitat classification (level 1) — crosswalk_jung_plvl1_data • aohCrosswalk data for Jung (2020) potential habitat classification (level 1) — crosswalk_jung_plvl1_data • aoh - +
@@ -38,7 +38,7 @@
- +
@@ -150,15 +150,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/crosswalk_lumb_cgls_data.html b/docs/reference/crosswalk_lumb_cgls_data.html index 02ea9146..b438938c 100644 --- a/docs/reference/crosswalk_lumb_cgls_data.html +++ b/docs/reference/crosswalk_lumb_cgls_data.html @@ -1,5 +1,5 @@ -Crosswalk data for CGLS based on Lumbierres et al. (2021) — crosswalk_lumb_cgls_data • aohCrosswalk data for CGLS based on Lumbierres et al. (2021) — crosswalk_lumb_cgls_data • aoh - +
@@ -40,7 +40,7 @@
- +
@@ -164,15 +164,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/figures/README-map-1.png b/docs/reference/figures/README-map-1.png index 883fd8af..8002e047 100644 Binary files a/docs/reference/figures/README-map-1.png and b/docs/reference/figures/README-map-1.png differ diff --git a/docs/reference/get_global_elevation_data-1.png b/docs/reference/get_global_elevation_data-1.png index 51ba134e..25e3c6f1 100644 Binary files a/docs/reference/get_global_elevation_data-1.png and b/docs/reference/get_global_elevation_data-1.png differ diff --git a/docs/reference/get_global_elevation_data.html b/docs/reference/get_global_elevation_data.html index f62b5219..9a8c9f99 100644 --- a/docs/reference/get_global_elevation_data.html +++ b/docs/reference/get_global_elevation_data.html @@ -1,12 +1,12 @@ -Get global elevation data — get_global_elevation_data • aohGet global elevation data — get_global_elevation_data • aoh - +
@@ -34,7 +34,7 @@
- +
@@ -82,7 +82,9 @@

Get global elevation data

Arguments

-
dir
+ + +
dir

character Folder path for downloading and caching data. By default, data are downloaded to a temporary directory (i.e., tempdir()). To avoid downloading the same data multiple times, it is @@ -90,7 +92,7 @@

Arguments

below).

-
version
+
version

character Value indicating the specific version of the dataset that should be downloaded. The version should be indicated using the @@ -100,13 +102,13 @@

Arguments

release of the dataset with available habitat data is used.

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
verbose
+
verbose

logical Should progress be displayed while downloading data? Defaults to TRUE.

@@ -114,9 +116,7 @@

Arguments

Value

- - -

A terra::rast() object containing the elevation data +

A terra::rast() object containing the elevation data (100 m resolution). Pixel values indicate elevation (m).

@@ -134,7 +134,7 @@

References

Robinson N, Regetz J, and Guralnick RP (2014) EarthEnv-DEM90: A nearly- global, void-free, multi-scale smoothed, 90m digital elevation model from fused ASTER and SRTM data. -ISPRS Journal of Photogrammetry and Remote Sensing, 87:57--67. +ISPRS Journal of Photogrammetry and Remote Sensing, 87:57–67. doi:10.1016/j.isprsjprs.2013.11.002

@@ -180,15 +180,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_jung_lvl1_habitat_data-1.png b/docs/reference/get_jung_lvl1_habitat_data-1.png index 7dad8f57..b5bbb595 100644 Binary files a/docs/reference/get_jung_lvl1_habitat_data-1.png and b/docs/reference/get_jung_lvl1_habitat_data-1.png differ diff --git a/docs/reference/get_jung_lvl1_habitat_data.html b/docs/reference/get_jung_lvl1_habitat_data.html index 5b845913..7a2f0c29 100644 --- a/docs/reference/get_jung_lvl1_habitat_data.html +++ b/docs/reference/get_jung_lvl1_habitat_data.html @@ -1,5 +1,5 @@ -Get Jung et al. (2020) habitat classification data (level 1) — get_jung_lvl1_habitat_data • aohGet Jung et al. (2020) habitat classification data (level 1) — get_jung_lvl1_habitat_data • aoh - +
@@ -35,7 +35,7 @@
- +
@@ -84,7 +84,9 @@

Get Jung et al. (2020) habitat classification data (level 1)

Arguments

-
dir
+ + +
dir

character Folder path for downloading and caching data. By default, data are downloaded to a temporary directory (i.e., tempdir()). To avoid downloading the same data multiple times, it is @@ -92,7 +94,7 @@

Arguments

below).

-
version
+
version

character Value indicating the specific version of the dataset that should be downloaded. The version should be indicated using the @@ -102,13 +104,13 @@

Arguments

release of the dataset with available habitat data is used.

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
verbose
+
verbose

logical Should progress be displayed while downloading data? Defaults to TRUE.

@@ -116,9 +118,7 @@

Arguments

Value

- - -

A terra::rast() object containing the habitat data +

A terra::rast() object containing the habitat data (100 m resolution). Pixel values indicate the habitat classification codes.

@@ -134,7 +134,7 @@

Details

References

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020a) A global map of -terrestrial habitat types. Scientific Data, 7, 1--8. +terrestrial habitat types. Scientific Data, 7, 1–8. doi:10.1038/s41597-020-00599-8

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020b) A global map of @@ -190,15 +190,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_jung_lvl2_habitat_data-1.png b/docs/reference/get_jung_lvl2_habitat_data-1.png index 18f70caf..99d2675f 100644 Binary files a/docs/reference/get_jung_lvl2_habitat_data-1.png and b/docs/reference/get_jung_lvl2_habitat_data-1.png differ diff --git a/docs/reference/get_jung_lvl2_habitat_data.html b/docs/reference/get_jung_lvl2_habitat_data.html index 873dc5e2..58268dcd 100644 --- a/docs/reference/get_jung_lvl2_habitat_data.html +++ b/docs/reference/get_jung_lvl2_habitat_data.html @@ -1,5 +1,5 @@ -Get Jung et al. (2020) habitat classification data (level 2) — get_jung_lvl2_habitat_data • aohGet Jung et al. (2020) habitat classification data (level 2) — get_jung_lvl2_habitat_data • aoh - +
@@ -35,7 +35,7 @@
- +
@@ -84,7 +84,9 @@

Get Jung et al. (2020) habitat classification data (level 2)

Arguments

-
dir
+ + +
dir

character Folder path for downloading and caching data. By default, data are downloaded to a temporary directory (i.e., tempdir()). To avoid downloading the same data multiple times, it is @@ -92,7 +94,7 @@

Arguments

below).

-
version
+
version

character Value indicating the specific version of the dataset that should be downloaded. The version should be indicated using the @@ -102,13 +104,13 @@

Arguments

release of the dataset with available habitat data is used.

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
verbose
+
verbose

logical Should progress be displayed while downloading data? Defaults to TRUE.

@@ -116,9 +118,7 @@

Arguments

Value

- - -

A terra::rast() object containing the habitat data +

A terra::rast() object containing the habitat data (100 m resolution). Pixel values indicate the habitat classification codes.

@@ -134,7 +134,7 @@

Details

References

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020a) A global map of -terrestrial habitat types. Scientific Data, 7, 1--8. +terrestrial habitat types. Scientific Data, 7, 1–8. doi:10.1038/s41597-020-00599-8

Jung M, Dahal PR, Butchart SHM, Donald PF, De Lamo X, Lesiv M, Kapos V, Rondinini C, and Visconti P (2020b) A global map of @@ -190,15 +190,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_jung_plvl1_habitat_data-1.png b/docs/reference/get_jung_plvl1_habitat_data-1.png index 2fe095fb..3e51c7a5 100644 Binary files a/docs/reference/get_jung_plvl1_habitat_data-1.png and b/docs/reference/get_jung_plvl1_habitat_data-1.png differ diff --git a/docs/reference/get_jung_plvl1_habitat_data.html b/docs/reference/get_jung_plvl1_habitat_data.html index a8813712..a423bb15 100644 --- a/docs/reference/get_jung_plvl1_habitat_data.html +++ b/docs/reference/get_jung_plvl1_habitat_data.html @@ -1,12 +1,12 @@ -Get Jung (2020) potential habitat classification data (level 1) — get_jung_plvl1_habitat_data • aohGet Jung (2020) potential habitat classification data (level 1) — get_jung_plvl1_habitat_data • aoh - +
@@ -34,7 +34,7 @@
- +
@@ -82,7 +82,9 @@

Get Jung (2020) potential habitat classification data (level 1)

Arguments

-
dir
+ + +
dir

character Folder path for downloading and caching data. By default, data are downloaded to a temporary directory (i.e., tempdir()). To avoid downloading the same data multiple times, it is @@ -90,7 +92,7 @@

Arguments

below).

-
version
+
version

character Value indicating the specific version of the dataset that should be downloaded. The version should be indicated using the @@ -100,13 +102,13 @@

Arguments

release of the dataset with available habitat data is used.

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
verbose
+
verbose

logical Should progress be displayed while downloading data? Defaults to TRUE.

@@ -114,9 +116,7 @@

Arguments

Value

- - -

A terra::rast() object containing the potential habitat data +

A terra::rast() object containing the potential habitat data (100 m resolution). Pixel values indicate the potential habitat classification codes.

@@ -192,15 +192,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_lumb_cgls_habitat_data-1.png b/docs/reference/get_lumb_cgls_habitat_data-1.png index e70fecd0..f4eac965 100644 Binary files a/docs/reference/get_lumb_cgls_habitat_data-1.png and b/docs/reference/get_lumb_cgls_habitat_data-1.png differ diff --git a/docs/reference/get_lumb_cgls_habitat_data.html b/docs/reference/get_lumb_cgls_habitat_data.html index cb042959..33babaf5 100644 --- a/docs/reference/get_lumb_cgls_habitat_data.html +++ b/docs/reference/get_lumb_cgls_habitat_data.html @@ -1,5 +1,5 @@ -Get Lumbierres et al. (2021) CGLS habitat classification data — get_lumb_cgls_habitat_data • aohGet Lumbierres et al. (2021) CGLS habitat classification data — get_lumb_cgls_habitat_data • aoh - +
@@ -37,7 +37,7 @@
- +
@@ -88,7 +88,9 @@

Get Lumbierres et al. (2021) CGLS habitat classification data

Arguments

-
dir
+ + +
dir

character Folder path for downloading and caching data. By default, data are downloaded to a temporary directory (i.e., tempdir()). To avoid downloading the same data multiple times, it is @@ -96,7 +98,7 @@

Arguments

below).

-
version
+
version

character Value indicating the specific version of the dataset that should be downloaded. The version should be indicated using the @@ -106,13 +108,13 @@

Arguments

release of the dataset with available habitat data is used.

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
verbose
+
verbose

logical Should progress be displayed while downloading data? Defaults to TRUE.

@@ -120,9 +122,7 @@

Arguments

Value

- - -

A terra::rast() object containing the habitat data +

A terra::rast() object containing the habitat data (100 m resolution). Pixel values indicate the habitat classification codes.

@@ -197,15 +197,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_spp_habitat_data.html b/docs/reference/get_spp_habitat_data.html index 11e8d088..32d82112 100644 --- a/docs/reference/get_spp_habitat_data.html +++ b/docs/reference/get_spp_habitat_data.html @@ -1,12 +1,12 @@ -Get species habitat data — get_spp_habitat_data • aohGet species habitat data — get_spp_habitat_data • aoh - +
@@ -34,7 +34,7 @@
- +
@@ -85,14 +85,16 @@

Get species habitat data

Arguments

-
x
+ + +
x

integer Taxon identifier for the species on the International Union for Conservation of Nature (IUCN) Red List of Threatened Species. For example, the taxon identifier for the species Loxodonta africana is 181008073.

-
dir
+
dir

character Folder path where data should be downloaded. By default, data are downloaded to a temporary directory (i.e., tempdir()). To avoid downloading the same data multiple times, @@ -102,7 +104,7 @@

Arguments

data are imported and not re-downloaded from the IUCN Red List.

-
version
+
version

character Value indicating version of the IUCN Red List for obtaining data (e.g., "2021-2"). Although it is not possible to query past versions @@ -112,27 +114,27 @@

Arguments

version of the IUCN Red List.

-
key
+
key

character Token for querying the IUCN Red List API. Defaults to NULL such that the token accessed from the "IUCN_REDLIST_KEY" environmental variable (which can be specified in the .Renviron file).

-
delay
+
delay

integer Number of seconds to wait between subsequent calls to the IUCN Red List API. Defaults to 2 seconds (as recommended by the rredlist package; https://docs.ropensci.org/rredlist/articles/rredlist.html).

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
verbose
+
verbose

logical Should progress be displayed while downloading data? Defaults to TRUE.

@@ -140,9 +142,7 @@

Arguments

Value

- - -

A table (tibble::tibble()) object.

+

A table (tibble::tibble()) object.

Details

@@ -153,7 +153,7 @@

Details

Accessing the IUCN Red List API

- +

You will need to obtain a token for the @@ -168,8 +168,8 @@

Accessing the IUCN Red List API

the token) and save the file:

IUCN_REDLIST_KEY="your_actual_token_not_this_string"

Please restart your R session. You should now be able to access the IUCN Red -List API. To verify this, please try running the following R code and -- -assuming everything works correctly -- you should see TRUE as the output:

+List API. To verify this, please try running the following R code and – +assuming everything works correctly – you should see TRUE as the output:

# verify access to IUCN Red List API
 is_iucn_rl_available()

If these instructions did not work, please consult the documentation for the @@ -222,15 +222,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_spp_summary_data.html b/docs/reference/get_spp_summary_data.html index f20d6e19..9c3789d5 100644 --- a/docs/reference/get_spp_summary_data.html +++ b/docs/reference/get_spp_summary_data.html @@ -1,5 +1,5 @@ -Get species summary data — get_spp_summary_data • aohGet species summary data — get_spp_summary_data • aoh - +
@@ -35,7 +35,7 @@
- +
@@ -87,14 +87,16 @@

Get species summary data

Arguments

-
x
+ + +
x

integer Taxon identifier for the species on the International Union for Conservation of Nature (IUCN) Red List of Threatened Species. For example, the taxon identifier for the species Loxodonta africana is 181008073.

-
dir
+
dir

character Folder path where data should be downloaded. By default, data are downloaded to a temporary directory (i.e., tempdir()). To avoid downloading the same data multiple times, @@ -104,7 +106,7 @@

Arguments

data are imported and not re-downloaded from the IUCN Red List.

-
version
+
version

character Value indicating version of the IUCN Red List for obtaining data (e.g., "2021-2"). Although it is not possible to query past versions @@ -114,27 +116,27 @@

Arguments

version of the IUCN Red List.

-
key
+
key

character Token for querying the IUCN Red List API. Defaults to NULL such that the token accessed from the "IUCN_REDLIST_KEY" environmental variable (which can be specified in the .Renviron file).

-
delay
+
delay

integer Number of seconds to wait between subsequent calls to the IUCN Red List API. Defaults to 2 seconds (as recommended by the rredlist package; https://docs.ropensci.org/rredlist/articles/rredlist.html).

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
verbose
+
verbose

logical Should progress be displayed while downloading data? Defaults to TRUE.

@@ -142,9 +144,7 @@

Arguments

Value

- - -

A table (tibble::tibble()) object.

+

A table (tibble::tibble()) object.

Details

@@ -155,7 +155,7 @@

Details

Accessing the IUCN Red List API

- +

You will need to obtain a token for the @@ -170,8 +170,8 @@

Accessing the IUCN Red List API

the token) and save the file:

IUCN_REDLIST_KEY="your_actual_token_not_this_string"

Please restart your R session. You should now be able to access the IUCN Red -List API. To verify this, please try running the following R code and -- -assuming everything works correctly -- you should see TRUE as the output:

+List API. To verify this, please try running the following R code and – +assuming everything works correctly – you should see TRUE as the output:

# verify access to IUCN Red List API
 is_iucn_rl_available()

If these instructions did not work, please consult the documentation for the @@ -224,15 +224,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/get_spp_threat_data.html b/docs/reference/get_spp_threat_data.html index 464e3fae..f9ddb629 100644 --- a/docs/reference/get_spp_threat_data.html +++ b/docs/reference/get_spp_threat_data.html @@ -1,12 +1,12 @@ -Get species threat data — get_spp_threat_data • aohGet species threat data — get_spp_threat_data • aoh - +
@@ -34,7 +34,7 @@
- +
@@ -85,14 +85,16 @@

Get species threat data

Arguments

-
x
+ + +
x

integer Taxon identifier for the species on the International Union for Conservation of Nature (IUCN) Red List of Threatened Species. For example, the taxon identifier for the species Loxodonta africana is 181008073.

-
dir
+
dir

character Folder path where data should be downloaded. By default, data are downloaded to a temporary directory (i.e., tempdir()). To avoid downloading the same data multiple times, @@ -102,7 +104,7 @@

Arguments

data are imported and not re-downloaded from the IUCN Red List.

-
version
+
version

character Value indicating version of the IUCN Red List for obtaining data (e.g., "2021-2"). Although it is not possible to query past versions @@ -112,27 +114,27 @@

Arguments

version of the IUCN Red List.

-
key
+
key

character Token for querying the IUCN Red List API. Defaults to NULL such that the token accessed from the "IUCN_REDLIST_KEY" environmental variable (which can be specified in the .Renviron file).

-
delay
+
delay

integer Number of seconds to wait between subsequent calls to the IUCN Red List API. Defaults to 2 seconds (as recommended by the rredlist package; https://docs.ropensci.org/rredlist/articles/rredlist.html).

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
verbose
+
verbose

logical Should progress be displayed while downloading data? Defaults to TRUE.

@@ -140,9 +142,7 @@

Arguments

Value

- - -

A table (tibble::tibble()) object.

+

A table (tibble::tibble()) object.

Details

@@ -157,7 +157,7 @@

Details

Accessing the IUCN Red List API

- +

You will need to obtain a token for the @@ -172,8 +172,8 @@

Accessing the IUCN Red List API

the token) and save the file:

IUCN_REDLIST_KEY="your_actual_token_not_this_string"

Please restart your R session. You should now be able to access the IUCN Red -List API. To verify this, please try running the following R code and -- -assuming everything works correctly -- you should see TRUE as the output:

+List API. To verify this, please try running the following R code and – +assuming everything works correctly – you should see TRUE as the output:

# verify access to IUCN Red List API
 is_iucn_rl_available()

If these instructions did not work, please consult the documentation for the @@ -226,15 +226,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index b1af4154..f8dbbaa3 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,9 +1,9 @@ -Function reference • aohPackage index • aoh - +
@@ -31,7 +31,7 @@
- +
@@ -260,15 +260,15 @@

Miscellaneous functions -

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/is_gdal_calc_available.html b/docs/reference/is_gdal_calc_available.html index fad3965a..90e95526 100644 --- a/docs/reference/is_gdal_calc_available.html +++ b/docs/reference/is_gdal_calc_available.html @@ -1,9 +1,9 @@ -Is gdal_calc.py available? — is_gdal_calc_available • aohIs gdal_calc.py available? — is_gdal_calc_available • aoh - +
@@ -31,7 +31,7 @@
- +
@@ -71,9 +71,7 @@

Is gdal_calc.py available?

Value

- - -

A logical value indicating if it is available.

+

A logical value indicating if it is available.

Details

@@ -106,15 +104,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/is_grass_available.html b/docs/reference/is_grass_available.html index 88fa4a3f..04db64a1 100644 --- a/docs/reference/is_grass_available.html +++ b/docs/reference/is_grass_available.html @@ -1,10 +1,10 @@ -Is GRASS available? — is_grass_available • aohIs GRASS available? — is_grass_available • aoh - +
@@ -32,7 +32,7 @@
- +
@@ -73,9 +73,7 @@

Is GRASS available?

Value

- - -

A logical value indicating if it is available.

+

A logical value indicating if it is available.

Details

@@ -108,15 +106,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/is_iucn_rl_api_available.html b/docs/reference/is_iucn_rl_api_available.html index 9e26ba27..b9d8a9a8 100644 --- a/docs/reference/is_iucn_rl_api_available.html +++ b/docs/reference/is_iucn_rl_api_available.html @@ -1,5 +1,5 @@ -Is IUCN Red List API available? — is_iucn_rl_api_available • aohIs IUCN Red List API available? — is_iucn_rl_api_available • aoh - +
@@ -35,7 +35,7 @@
- +
@@ -79,26 +79,26 @@

Is IUCN Red List API available?

Arguments

-
key
+ + +
key

character Token for querying the IUCN Red List API. Defaults to NULL such that the token accessed from the "IUCN_REDLIST_KEY" environmental variable (which can be specified in the .Renviron file).

-
n
+
n

integer Number of times to attempt to access the API.

Value

- - -

A logical indicating if the IUCN Red List API can be accessed.

+

A logical indicating if the IUCN Red List API can be accessed.

Accessing the IUCN Red List API

- +

You will need to obtain a token for the @@ -113,8 +113,8 @@

Accessing the IUCN Red List API

the token) and save the file:

IUCN_REDLIST_KEY="your_actual_token_not_this_string"

Please restart your R session. You should now be able to access the IUCN Red -List API. To verify this, please try running the following R code and -- -assuming everything works correctly -- you should see TRUE as the output:

+List API. To verify this, please try running the following R code and – +assuming everything works correctly – you should see TRUE as the output:

# verify access to IUCN Red List API
 is_iucn_rl_available()

If these instructions did not work, please consult the documentation for the @@ -143,15 +143,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/is_osgeo4w_available.html b/docs/reference/is_osgeo4w_available.html index 17710df1..98e195a8 100644 --- a/docs/reference/is_osgeo4w_available.html +++ b/docs/reference/is_osgeo4w_available.html @@ -1,9 +1,9 @@ -Is OSGeo4W available? — is_osgeo4w_available • aohIs OSGeo4W available? — is_osgeo4w_available • aoh - +
@@ -31,7 +31,7 @@
- +
@@ -71,9 +71,7 @@

Is OSGeo4W available?

Value

- - -

A logical value indicating if it is available.

+

A logical value indicating if it is available.

Details

@@ -115,15 +113,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/iucn_habitat_codes_artificial.html b/docs/reference/iucn_habitat_codes_artificial.html index d490719b..4673a00c 100644 --- a/docs/reference/iucn_habitat_codes_artificial.html +++ b/docs/reference/iucn_habitat_codes_artificial.html @@ -1,5 +1,5 @@ -IUCN Red List codes for artificial habitats — iucn_habitat_codes_artificial • aohIUCN Red List codes for artificial habitats — iucn_habitat_codes_artificial • aoh - +
@@ -36,7 +36,7 @@
- +
@@ -81,13 +81,11 @@

IUCN Red List codes for artificial habitats

Value

- - -

A character vector of codes.

+

A character vector of codes.

See also

-

Other codes: +

@@ -115,15 +113,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/iucn_habitat_codes_introduced.html b/docs/reference/iucn_habitat_codes_introduced.html index 694310a0..6952089c 100644 --- a/docs/reference/iucn_habitat_codes_introduced.html +++ b/docs/reference/iucn_habitat_codes_introduced.html @@ -1,5 +1,5 @@ -IUCN Red List codes for introduced habitats — iucn_habitat_codes_introduced • aohIUCN Red List codes for introduced habitats — iucn_habitat_codes_introduced • aoh - +
@@ -36,7 +36,7 @@
- +
@@ -81,13 +81,11 @@

IUCN Red List codes for introduced habitats

Value

- - -

A character vector of codes.

+

A character vector of codes.

See also

-

Other codes: +

@@ -113,15 +111,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/iucn_habitat_codes_marine.html b/docs/reference/iucn_habitat_codes_marine.html index c6a0bd71..ef94a77d 100644 --- a/docs/reference/iucn_habitat_codes_marine.html +++ b/docs/reference/iucn_habitat_codes_marine.html @@ -1,5 +1,5 @@ -IUCN Red List codes for marine habitats — iucn_habitat_codes_marine • aohIUCN Red List codes for marine habitats — iucn_habitat_codes_marine • aoh - +
@@ -35,7 +35,7 @@
- +
@@ -79,13 +79,11 @@

IUCN Red List codes for marine habitats

Value

- - -

A character vector of codes.

+

A character vector of codes.

See also

-

Other codes: +

@@ -115,15 +113,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/iucn_habitat_codes_misc.html b/docs/reference/iucn_habitat_codes_misc.html index eab579d0..e3b58862 100644 --- a/docs/reference/iucn_habitat_codes_misc.html +++ b/docs/reference/iucn_habitat_codes_misc.html @@ -1,5 +1,5 @@ -IUCN Red List codes for miscellaneous habitats — iucn_habitat_codes_misc • aohIUCN Red List codes for miscellaneous habitats — iucn_habitat_codes_misc • aoh - +
@@ -36,7 +36,7 @@
- +
@@ -81,9 +81,7 @@

IUCN Red List codes for miscellaneous habitats

Value

- - -

A character vector of codes.

+

A character vector of codes.

@@ -106,15 +104,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/iucn_habitat_codes_terrestrial.html b/docs/reference/iucn_habitat_codes_terrestrial.html index 9ba05e11..2da3cbb8 100644 --- a/docs/reference/iucn_habitat_codes_terrestrial.html +++ b/docs/reference/iucn_habitat_codes_terrestrial.html @@ -1,5 +1,5 @@ -IUCN Red List codes for terrestrial habitats — iucn_habitat_codes_terrestrial • aohIUCN Red List codes for terrestrial habitats — iucn_habitat_codes_terrestrial • aoh - +
@@ -35,7 +35,7 @@
- +
@@ -79,13 +79,11 @@

IUCN Red List codes for terrestrial habitats

Value

- - -

A character vector of codes.

+

A character vector of codes.

See also

-

Other codes: +

@@ -121,15 +119,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/iucn_habitat_data.html b/docs/reference/iucn_habitat_data.html index 58c9554a..c7e7f31f 100644 --- a/docs/reference/iucn_habitat_data.html +++ b/docs/reference/iucn_habitat_data.html @@ -1,5 +1,5 @@ -IUCN habitat classification codes — iucn_habitat_data • aohIUCN habitat classification codes — iucn_habitat_data • aoh - +
@@ -35,7 +35,7 @@
- +
@@ -150,15 +150,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/iucn_threat_data.html b/docs/reference/iucn_threat_data.html index ec0337c4..b8e71d55 100644 --- a/docs/reference/iucn_threat_data.html +++ b/docs/reference/iucn_threat_data.html @@ -1,5 +1,5 @@ -IUCN threat classification codes — iucn_threat_data • aohIUCN threat classification codes — iucn_threat_data • aoh - +
@@ -35,7 +35,7 @@
- +
@@ -130,15 +130,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/plot_spp_aoh_data-1.png b/docs/reference/plot_spp_aoh_data-1.png index 54d734bc..0e643f76 100644 Binary files a/docs/reference/plot_spp_aoh_data-1.png and b/docs/reference/plot_spp_aoh_data-1.png differ diff --git a/docs/reference/plot_spp_aoh_data-2.png b/docs/reference/plot_spp_aoh_data-2.png index d3462198..9267be8e 100644 Binary files a/docs/reference/plot_spp_aoh_data-2.png and b/docs/reference/plot_spp_aoh_data-2.png differ diff --git a/docs/reference/plot_spp_aoh_data-3.png b/docs/reference/plot_spp_aoh_data-3.png index c102cd8c..f91cb397 100644 Binary files a/docs/reference/plot_spp_aoh_data-3.png and b/docs/reference/plot_spp_aoh_data-3.png differ diff --git a/docs/reference/plot_spp_aoh_data.html b/docs/reference/plot_spp_aoh_data.html index 292475fd..d42e3373 100644 --- a/docs/reference/plot_spp_aoh_data.html +++ b/docs/reference/plot_spp_aoh_data.html @@ -1,9 +1,9 @@ -Plot species range and Area of Habitat data — plot_spp_aoh_data • aohPlot species range and Area of Habitat data — plot_spp_aoh_data • aoh - +
@@ -31,7 +31,7 @@
- +
@@ -79,32 +79,34 @@

Plot species range and Area of Habitat data

Arguments

-
x
+ + +
x

sf::st_sf() Object containing the species data. This object should be produced using the create_spp_aoh_data() function.

-
max_plot
+
max_plot

integer Maximum number of Area of Habitat datasets to plot. Defaults to 9.

-
expand
+
expand

numeric Proportion to expand the plotting limits. Defaults to 0.05 such that plot limits are extended 5% beyond the spatial extent of the data.

-
zoom
+
zoom

numeric Value indicating the zoom level for the basemap. See documentation for the zoom parameter in the ggmap::get_stadiamap() function for details. Defaults to NULL such that no basemap is shown.

-
maptype
+
maptype

character Value indicating the name of the the basemap to use for the plot. See documentation for the maptype parameter in the @@ -114,20 +116,18 @@

Arguments

Note that the ggmap package must be installed to show a basemap.

-
maxcell
+
maxcell

integer Maximum number of grid cells for mapping. Defaults to 50000.

-
...
+
...

Additional arguments passed to ggmap::get_stadiamap().

Value

- - -

A ggplot2::ggplot() object.

+

A ggplot2::ggplot() object.

Details

@@ -165,19 +165,19 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [340ms] +#> initializing [343ms] #> #> cleaning species range data -#> cleaning species range data [3.4s] +#> cleaning species range data [3s] #> #> importing species summary data -#> importing species summary data [339ms] +#> importing species summary data [329ms] #> #> importing species habitat data #> importing species habitat data [329ms] #> #> collating species data -#> collating species data [222ms] +#> collating species data [217ms] #> #> post-processing results #> post-processing results [10ms] @@ -195,19 +195,19 @@

Examples

#> initializing [4ms] #> #> importing global elevation data -#> importing global elevation data [6.9s] +#> importing global elevation data [7.5s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [5.2s] +#> importing global habitat data [5.1s] #> #> generating Area of Habitat data #> skipping 4 species distributions already processed -#> generating Area of Habitat data [37ms] +#> generating Area of Habitat data [32ms] #> #> post-processing results -#> post-processing results [13ms] +#> post-processing results [11ms] #> #> finished @@ -271,7 +271,6 @@

Examples

#> The following object is masked from ‘package:terra’: #> #> inset -#> |---------|---------|---------|---------| ========================================= |---------|---------|---------|---------| ========================================= #> © Stadia Maps © Stamen Design © OpenMapTiles © OpenStreetMap contributors. #> Coordinate system already present. Adding new coordinate system, which will #> replace the existing one. @@ -291,15 +290,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/plot_spp_frc_data-1.png b/docs/reference/plot_spp_frc_data-1.png index c1cc4b5d..1212236a 100644 Binary files a/docs/reference/plot_spp_frc_data-1.png and b/docs/reference/plot_spp_frc_data-1.png differ diff --git a/docs/reference/plot_spp_frc_data-2.png b/docs/reference/plot_spp_frc_data-2.png index 943438ea..dfc4a8d8 100644 Binary files a/docs/reference/plot_spp_frc_data-2.png and b/docs/reference/plot_spp_frc_data-2.png differ diff --git a/docs/reference/plot_spp_frc_data-3.png b/docs/reference/plot_spp_frc_data-3.png index e369dd63..7ae36ed2 100644 Binary files a/docs/reference/plot_spp_frc_data-3.png and b/docs/reference/plot_spp_frc_data-3.png differ diff --git a/docs/reference/plot_spp_frc_data.html b/docs/reference/plot_spp_frc_data.html index e2d101d0..5cedd4cb 100644 --- a/docs/reference/plot_spp_frc_data.html +++ b/docs/reference/plot_spp_frc_data.html @@ -1,10 +1,10 @@ -Plot species range and fractional coverage data — plot_spp_frc_data • aohPlot species range and fractional coverage data — plot_spp_frc_data • aoh - +
@@ -32,7 +32,7 @@
- +
@@ -81,32 +81,34 @@

Plot species range and fractional coverage data

Arguments

-
x
+ + +
x

sf::st_sf() Object containing the species data. This object should be produced using the calc_spp_frc_data() function.

-
max_plot
+
max_plot

integer Maximum number of Area of Habitat datasets to plot. Defaults to 9.

-
expand
+
expand

numeric Proportion to expand the plotting limits. Defaults to 0.05 such that plot limits are extended 5% beyond the spatial extent of the data.

-
zoom
+
zoom

numeric Value indicating the zoom level for the basemap. See documentation for the zoom parameter in the ggmap::get_stadiamap() function for details. Defaults to NULL such that no basemap is shown.

-
maptype
+
maptype

character Value indicating the name of the the basemap to use for the plot. See documentation for the maptype parameter in the @@ -116,20 +118,18 @@

Arguments

Note that the ggmap package must be installed to show a basemap.

-
maxcell
+
maxcell

integer Maximum number of grid cells for mapping. Defaults to 50000.

-
...
+
...

Additional arguments passed to ggmap::get_stadiamap().

Value

- - -

A ggplot2::ggplot() object.

+

A ggplot2::ggplot() object.

Details

@@ -167,19 +167,19 @@

Examples

cache_dir = cache_dir ) #> initializing -#> initializing [336ms] +#> initializing [342ms] #> #> cleaning species range data -#> cleaning species range data [3.3s] +#> cleaning species range data [3.1s] #> #> importing species summary data -#> importing species summary data [334ms] +#> importing species summary data [332ms] #> #> importing species habitat data -#> importing species habitat data [332ms] +#> importing species habitat data [384ms] #> #> collating species data -#> collating species data [220ms] +#> collating species data [223ms] #> #> post-processing results #> post-processing results [10ms] @@ -198,19 +198,19 @@

Examples

#> initializing [4ms] #> #> importing global elevation data -#> importing global elevation data [6.9s] +#> importing global elevation data [6.8s] #> #> importing global habitat data #> ! argument to "crosswalk_data" is missing the following 2 habitat classification codes: "7.1", "7.2" #> importing global habitat data -#> importing global habitat data [4.9s] +#> importing global habitat data [5.7s] #> #> generating Area of Habitat data #> skipping 4 species distributions already processed -#> generating Area of Habitat data [34ms] +#> generating Area of Habitat data [32ms] #> #> post-processing results -#> post-processing results [32ms] +#> post-processing results [31ms] #> #> finished @@ -223,7 +223,7 @@

Examples

) #> importing global habitat data #> skipping 4 species distributions already processed -#> importing global habitat data [5.4s] +#> importing global habitat data [5.3s] #> # plot the data to visualize the range maps and fractional coverage data p <- plot_spp_frc_data(spp_frc_data) @@ -292,15 +292,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/read_spp_range_data.html b/docs/reference/read_spp_range_data.html index f45ff139..8b5ebcc1 100644 --- a/docs/reference/read_spp_range_data.html +++ b/docs/reference/read_spp_range_data.html @@ -1,11 +1,11 @@ -Read species range data — read_spp_range_data • aohRead species range data — read_spp_range_data • aoh - +
@@ -33,7 +33,7 @@
- +
@@ -75,20 +75,20 @@

Read species range data

Arguments

-
path
+ + +
path

character File path to the data (zip archive) file.

-
n
+
n

numeric Number of features in the dataset to import. Defaults to NULL such that all available data is imported.

Value

- - -

A sf::sf() object containing the dataset.

+

A sf::sf() object containing the dataset.

Details

@@ -149,15 +149,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/simulate_spp_data.html b/docs/reference/simulate_spp_data.html index 09a635ab..e0cc08c6 100644 --- a/docs/reference/simulate_spp_data.html +++ b/docs/reference/simulate_spp_data.html @@ -1,11 +1,11 @@ -Simulate species data — simulate_spp_data • aohSimulate species data — simulate_spp_data • aoh - +
@@ -33,7 +33,7 @@
- +
@@ -88,16 +88,18 @@

Simulate species data

Arguments

-
n
+ + +
n

integer Number of species to simulate.

-
boundary_data
+
boundary_data

sf::st_sf() Spatial object delineating the spatial extent and boundary for simulating species ranges.

-
habitat_data
+
habitat_data

terra::rast() Raster data indicating the presence of different habitat classes across world (e.g., Jung et al. 2020a,b; Lumbierres et al. 2021). @@ -108,7 +110,7 @@

Arguments

get_lumb_cgls_habitat_data()).

-
elevation_data
+
elevation_data

terra::rast() Raster data delineating the worldwide elevation data (e.g., Robinson et al. 2014). Defaults to NULL such that data @@ -117,7 +119,7 @@

Arguments

of the habitat data will be used to reduce processing time.

-
crosswalk_data
+
crosswalk_data

data.frame() Table containing data that indicate which grid cell values in the argument to habitat_data correspond to which IUCN habitat classification codes. The argument should contain @@ -128,28 +130,28 @@

Arguments

data are used (i.e., crosswalk_lumb_cgls_data()).

-
rf_scale_min
+
rf_scale_min

numeric Minimum scaling parameter used to control the smallest possible level of spatial auto-correlation for simulated species ranges. Defaults to 0.5.

-
rf_scale_max
+
rf_scale_max

numeric Minimum scaling parameter used to control the largest possible level of spatial auto-correlation for simulated species ranges. Defaults to 0.7.

-
cache_dir
+
cache_dir

character Folder path for downloading and caching data. By default, a temporary directory is used (i.e., tempdir()). To avoid downloading the same data multiple times, it is strongly recommended to specify a persistent storage location (see Examples below).

-
habitat_version
+
habitat_version

character Version of the habitat dataset that should be used. See documentation for the the version parameter in the get_lumb_cgls_habitat_data() function @@ -160,13 +162,13 @@

Arguments

used if data need to be obtained.

-
force
+
force

logical Should the data be downloaded even if the the data are already available? Defaults to FALSE.

-
omit_habitat_codes
+
omit_habitat_codes

character Habitat classification codes to omit from resulting Area of Habitat data. Please see the IUCN Red List Habitat Classification Scheme @@ -182,16 +184,14 @@

Arguments

habitats are excluded.

-
verbose
+
verbose

logical Should progress be displayed while processing data? Defaults to TRUE.

Value

- - -

A list object containing simulated data that are formatted following +

A list object containing simulated data that are formatted following conventions used by the International Union for Conservation of Nature (IUCN) Red List of Threatened Species. It contains the following elements:

spp_range_data
@@ -214,7 +214,7 @@

References

Hilton-Taylor C, Hoffmann M, Jenkins CN, Joppa L, Li BV, Menon V, Ocampo-Peñuela N, Rondinini C (2019) Measuring terrestrial Area of Habitat (AOH) and its utility for the IUCN Red List. Trends in Ecology & Evolution, -34, 977--986. doi:10.1016/j.tree.2019.06.009

+34, 977–986. doi:10.1016/j.tree.2019.06.009

See also

@@ -253,7 +253,7 @@

Examples

#> importing global elevation data [7.2s] #> #> importing global habitat data -#> importing global habitat data [44.8s] +#> importing global habitat data [45.6s] #> # preview species range data @@ -358,15 +358,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/st_repair_geometry.html b/docs/reference/st_repair_geometry.html index cd0c399b..0e459acf 100644 --- a/docs/reference/st_repair_geometry.html +++ b/docs/reference/st_repair_geometry.html @@ -1,9 +1,9 @@ -Repair geometry — st_repair_geometry • aohRepair geometry — st_repair_geometry • aoh - +
@@ -31,7 +31,7 @@
- +
@@ -71,11 +71,13 @@

Repair geometry

Arguments

-
x
+ + +
x

sf::sf() object.

-
geometry_precision
+
geometry_precision

numeric level of precision for processing the spatial data (used with sf::st_set_precision()). The default is 100000 (higher values indicate higher precision). @@ -98,7 +100,7 @@

Details

Installation

- +

This function uses the prepr package to help repair geometries in certain cases. Because the prepr package is not available on @@ -146,15 +148,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/system_gdal_version.html b/docs/reference/system_gdal_version.html index eeac6e74..3b8cdc33 100644 --- a/docs/reference/system_gdal_version.html +++ b/docs/reference/system_gdal_version.html @@ -1,10 +1,10 @@ -System GDAL version — system_gdal_version • aohSystem GDAL version — system_gdal_version • aoh - +
@@ -32,7 +32,7 @@
- +
@@ -73,9 +73,7 @@

System GDAL version

Value

- - -

A character value describing the version of GDAL installed. +

A character value describing the version of GDAL installed. If GDAL is not installed, then a missing (NA) value is returned.

@@ -99,15 +97,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/terra_combine-1.png b/docs/reference/terra_combine-1.png index 25bdea6c..d8eb49a4 100644 Binary files a/docs/reference/terra_combine-1.png and b/docs/reference/terra_combine-1.png differ diff --git a/docs/reference/terra_combine.html b/docs/reference/terra_combine.html index 01e33c09..e9f3a63d 100644 --- a/docs/reference/terra_combine.html +++ b/docs/reference/terra_combine.html @@ -1,10 +1,10 @@ -Combine rasters — terra_combine • aohCombine rasters — terra_combine • aoh - +
@@ -32,7 +32,7 @@
- +
@@ -73,15 +73,15 @@

Combine rasters

Arguments

-
x
+ + +
x

list of terra::rast() objects.

Value

- - -

A terra::rast() object.

+

A terra::rast() object.

@@ -145,15 +145,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/terra_gdal_calc.html b/docs/reference/terra_gdal_calc.html index 095fc88e..57f30a48 100644 --- a/docs/reference/terra_gdal_calc.html +++ b/docs/reference/terra_gdal_calc.html @@ -1,10 +1,10 @@ -GDAL calculate — terra_gdal_calc • aohGDAL calculate — terra_gdal_calc • aoh - +
@@ -32,7 +32,7 @@
- +
@@ -89,23 +89,25 @@

GDAL calculate

Arguments

-
x
+ + +
x

terra::rast() Raster object with source data.

-
expr
+
expr

character Value containing expression.

-
y
+
y

terra::rast() Optional raster for calculations.

-
z
+
z

terra::rast() Optional raster for calculations.

-
n_threads
+
n_threads

integer Number of computational threads to use for data processing. To reduce run time, it is strongly recommended to set this @@ -113,57 +115,57 @@

Arguments

Defaults to 1.

-
filename
+
filename

character Filename for output raster. Defaults to tempfile(fileext = ".tif").

-
datatype
+
datatype

character Value indicating the data type for saving data. Defaults to "FLT4S".

-
tiled
+
tiled

logical Value indicating if GeoTIFF files should be tiled. Defaults to FALSE.

-
bigtiff
+
bigtiff

logical Value indicating the data should be stored in BIGTIFF format. Defaults to FALSE.

-
compress
+
compress

character Value indicating compression format. Available options include "LZW" and "DEFLATE". Defaults to "LZW".

-
predictor
+
predictor

integer Predictor for GeoTIFF compression (see GDAL documentation). Defaults to 1 such that no predictor is used for compression.

-
nbits
+
nbits

integer Number of bits for output data. Defaults to NULL such that the number of bits is automatically determined.

-
verbose
+
verbose

logical Should information be displayed during processing? Defaults to TRUE.

-
NAflag
+
NAflag

numeric Value for representing missing (NA) values. A "none" value can also be used to indicate that no flag should be set. Defaults to NULL such that the value is determined automatically.

-
output_raster
+
output_raster

logical Should a raster (terra::rast()) object be returned? If FALSE then the file path for the resulting file is returned. @@ -172,13 +174,11 @@

Arguments

Value

- - -

A terra::rast() raster object.

+

A terra::rast() raster object.

Troubleshooting

- +

The function aims to automatically determine the best approach to run the gdal_calc.py script. However, it is not always successful. @@ -233,7 +233,7 @@

Examples

# run calculation y <- terra_gdal_calc(x, "(X < 20) * 1") -#> System command: gdal_calc.py -X "/tmp/RtmpMWqE49/file354221a7b45e6.tif" --outfile="/tmp/RtmpMWqE49/file354227be0f154.tif" --calc="(X < 20) * 1" --type="Float32" --co="NUM_THREADS=1" --co="COMPRESS=LZW" --co="PREDICTOR=1" +#> System command: gdal_calc.py -X "/tmp/RtmpdwyfC9/filed3bba7c30196.tif" --outfile="/tmp/RtmpdwyfC9/filed3bbaaeae41b.tif" --calc="(X < 20) * 1" --type="Float32" --co="NUM_THREADS=1" --co="COMPRESS=LZW" --co="PREDICTOR=1" # preview result print(y) @@ -242,7 +242,7 @@

Examples

#> resolution : 0.5, 0.5 (x, y) #> extent : -110, -90, 40, 60 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) -#> source : file354227be0f154.tif +#> source : filed3bbaaeae41b.tif #> name : lyr.1 # }
@@ -259,15 +259,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/terra_gdal_crop.html b/docs/reference/terra_gdal_crop.html index 85543d82..daf0868c 100644 --- a/docs/reference/terra_gdal_crop.html +++ b/docs/reference/terra_gdal_crop.html @@ -1,10 +1,10 @@ -Crop a raster using GDAL — terra_gdal_crop • aohCrop a raster using GDAL — terra_gdal_crop • aoh - +
@@ -32,7 +32,7 @@
- +
@@ -86,15 +86,17 @@

Crop a raster using GDAL

Arguments

-
x
+ + +
x

terra::rast() Raster object with source data.

-
ext
+
ext

terra::ext() Raster extent object.

-
n_threads
+
n_threads

integer Number of computational threads to use for data processing. To reduce run time, it is strongly recommended to set this @@ -102,50 +104,50 @@

Arguments

Defaults to 1.

-
filename
+
filename

character Filename for output raster. Defaults to tempfile(fileext = ".tif").

-
datatype
+
datatype

character Value indicating the data type for saving data. Defaults to "FLT4S".

-
cache_limit
+
cache_limit

integer Number of MB to use for GDAL caching. Defaults to 200.

-
tiled
+
tiled

logical Value indicating if GeoTIFF files should be tiled. Defaults to FALSE.

-
bigtiff
+
bigtiff

logical Value indicating the data should be stored in BIGTIFF format. Defaults to FALSE.

-
compress
+
compress

character Value indicating compression format. Available options include "LZW" and "DEFLATE". Defaults to "LZW".

-
verbose
+
verbose

logical Should information be displayed during processing? Defaults to TRUE.

-
NAflag
+
NAflag

numeric Value for representing missing (NA) values. A "none" value can also be used to indicate that no flag should be set. Defaults to NULL such that the value is determined automatically.

-
output_raster
+
output_raster

logical Should a raster (terra::rast()) object be returned? If FALSE then the file path for the resulting file is returned. @@ -154,9 +156,7 @@

Arguments

Value

- - -

A terra::rast() raster object.

+

A terra::rast() raster object.

@@ -184,7 +184,7 @@

Examples

#> resolution : 0.5, 0.5 (x, y) #> extent : -105, -92.5, 41, 58.5 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) -#> source : file354221288aec8.tif +#> source : filed3bba79eee7d0.tif #> name : lyr.1
@@ -200,15 +200,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/terra_gdal_project.html b/docs/reference/terra_gdal_project.html index 4a697b5d..96327565 100644 --- a/docs/reference/terra_gdal_project.html +++ b/docs/reference/terra_gdal_project.html @@ -1,10 +1,10 @@ -Project a raster using GDAL — terra_gdal_project • aohProject a raster using GDAL — terra_gdal_project • aoh - +
@@ -32,7 +32,7 @@
- +
@@ -87,20 +87,22 @@

Project a raster using GDAL

Arguments

-
x
+ + +
x

terra::rast() Raster object with source data.

-
y
+
y

terra::rast() Raster object specifying spatial properties for output data.

-
method
+
method

character Name of interpolation method.

-
n_threads
+
n_threads

integer Number of computational threads to use for data processing. To reduce run time, it is strongly recommended to set this @@ -108,50 +110,50 @@

Arguments

Defaults to 1.

-
filename
+
filename

character Filename for output raster. Defaults to tempfile(fileext = ".tif").

-
datatype
+
datatype

character Value indicating the data type for saving data. Defaults to "FLT4S".

-
cache_limit
+
cache_limit

integer Number of MB to use for GDAL caching. Defaults to 200.

-
tiled
+
tiled

logical Value indicating if GeoTIFF files should be tiled. Defaults to FALSE.

-
bigtiff
+
bigtiff

logical Value indicating the data should be stored in BIGTIFF format. Defaults to FALSE.

-
compress
+
compress

character Value indicating compression format. Available options include "LZW" and "DEFLATE". Defaults to "LZW".

-
verbose
+
verbose

logical Should information be displayed during processing? Defaults to TRUE.

-
NAflag
+
NAflag

numeric Value for representing missing (NA) values. A "none" value can also be used to indicate that no flag should be set. Defaults to NULL such that the value is determined automatically.

-
output_raster
+
output_raster

logical Should a raster (terra::rast()) object be returned? If FALSE then the file path for the resulting file is returned. @@ -160,9 +162,7 @@

Arguments

Value

- - -

A terra::rast() raster object.

+

A terra::rast() raster object.

@@ -194,7 +194,7 @@

Examples

#> resolution : 19999.99, 20000 (x, y) #> extent : -944881, 935118, 4664377, 7144377 (xmin, xmax, ymin, ymax) #> coord. ref. : +proj=lcc +lat_0=0 +lon_0=-100 +lat_1=48 +lat_2=33 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs -#> source : file354226d32e688.tif +#> source : filed3bba511fe292.tif #> name : lyr.1
@@ -210,15 +210,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/reference/terra_gdal_rasterize-1.png b/docs/reference/terra_gdal_rasterize-1.png index 073bf116..70323ead 100644 Binary files a/docs/reference/terra_gdal_rasterize-1.png and b/docs/reference/terra_gdal_rasterize-1.png differ diff --git a/docs/reference/terra_gdal_rasterize.html b/docs/reference/terra_gdal_rasterize.html index ac895728..52f588ac 100644 --- a/docs/reference/terra_gdal_rasterize.html +++ b/docs/reference/terra_gdal_rasterize.html @@ -1,10 +1,10 @@ -Convert vector data into a raster using GDAL — terra_gdal_rasterize • aohConvert vector data into a raster using GDAL — terra_gdal_rasterize • aoh - +
@@ -32,7 +32,7 @@
- +
@@ -93,31 +93,33 @@

Convert vector data into a raster using GDAL

Arguments

-
x
+ + +
x

terra::rast() Raster object with source data.

-
sf
+
sf

sf::st_sf() Spatial object to rasterize.

-
burn
+
burn

numeric Value for encoding the vector data. Defaults to 1.

-
init
+
init

numeric Value for encoding background cells that do not overlap with the vector data. Defaults to 0.

-
invert
+
invert

logical Should the burn process be inverted? Defaults to FALSE.

-
update
+
update

logical Should the result by producing by updating the argument to x? If FALSE then the argument to x is only used to specify the @@ -126,14 +128,14 @@

Arguments

Defaults to FALSE.

-
touches
+
touches

logical Should cells of x that are overlap with any part of sf be treated as covered by sf? Defaults to FALSE, such that only cells that have their centroid covered by sf are treated as covered.

-
n_threads
+
n_threads

integer Number of computational threads to use for data processing. To reduce run time, it is strongly recommended to set this @@ -141,62 +143,62 @@

Arguments

Defaults to 1.

-
filename
+
filename

character Filename for output raster. Defaults to tempfile(fileext = ".tif").

-
sf_filename
+
sf_filename

character File name to temporarily save argument to sf. Defaults to a temporary (geopackage) file.

-
datatype
+
datatype

character Value indicating the data type for saving data. Defaults to "FLT4S".

-
cache_limit
+
cache_limit

integer Number of MB to use for GDAL caching. Defaults to 200.

-
tiled
+
tiled

logical Value indicating if GeoTIFF files should be tiled. Defaults to FALSE.

-
bigtiff
+
bigtiff

logical Value indicating the data should be stored in BIGTIFF format. Defaults to FALSE.

-
nbits
+
nbits

integer Number of bits for output data. Defaults to NULL such that the number of bits is automatically determined.

-
compress
+
compress

character Value indicating compression format. Available options include "LZW" and "DEFLATE". Defaults to "LZW".

-
NAflag
+
NAflag

numeric Value for representing missing (NA) values. A "none" value can also be used to indicate that no flag should be set. Defaults to NULL such that the value is determined automatically.

-
verbose
+
verbose

logical Should information be displayed during processing? Defaults to TRUE.

-
output_raster
+
output_raster

logical Should a raster (terra::rast()) object be returned? If FALSE then the file path for the resulting file is returned. @@ -205,9 +207,7 @@

Arguments

Value

- - -

A terra::rast() raster object.

+

A terra::rast() raster object.

@@ -242,15 +242,15 @@

Examples

-

Site built with pkgdown 2.0.7.

+

Site built with pkgdown 2.1.0.

- - + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index ab2c85d3..d09781bb 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,144 +1,50 @@ - - - - /404.html - - - /articles/aoh.html - - - /articles/customization.html - - - /articles/index.html - - - /authors.html - - - /index.html - - - /news/index.html - - - /reference/aoh.html - - - /reference/calc_spp_frc_data.html - - - /reference/create_spp_aoh_data.html - - - /reference/create_spp_frc_data.html - - - /reference/create_spp_info_data.html - - - /reference/crosswalk_jung_lvl1_data.html - - - /reference/crosswalk_jung_lvl2_data.html - - - /reference/crosswalk_jung_plvl1_data.html - - - /reference/crosswalk_lumb_cgls_data.html - - - /reference/get_global_elevation_data.html - - - /reference/get_jung_lvl1_habitat_data.html - - - /reference/get_jung_lvl2_habitat_data.html - - - /reference/get_jung_plvl1_habitat_data.html - - - /reference/get_lumb_cgls_habitat_data.html - - - /reference/get_spp_habitat_data.html - - - /reference/get_spp_summary_data.html - - - /reference/get_spp_threat_data.html - - - /reference/index.html - - - /reference/is_gdal_calc_available.html - - - /reference/is_grass_available.html - - - /reference/is_iucn_rl_api_available.html - - - /reference/is_osgeo4w_available.html - - - /reference/iucn_habitat_codes_artificial.html - - - /reference/iucn_habitat_codes_introduced.html - - - /reference/iucn_habitat_codes_marine.html - - - /reference/iucn_habitat_codes_misc.html - - - /reference/iucn_habitat_codes_terrestrial.html - - - /reference/iucn_habitat_data.html - - - /reference/iucn_threat_data.html - - - /reference/plot_spp_aoh_data.html - - - /reference/plot_spp_frc_data.html - - - /reference/read_spp_range_data.html - - - /reference/simulate_spp_data.html - - - /reference/st_repair_geometry.html - - - /reference/system_gdal_version.html - - - /reference/terra_combine.html - - - /reference/terra_gdal_calc.html - - - /reference/terra_gdal_crop.html - - - /reference/terra_gdal_project.html - - - /reference/terra_gdal_rasterize.html - + +/404.html +/articles/aoh.html +/articles/customization.html +/articles/index.html +/authors.html +/index.html +/news/index.html +/reference/aoh.html +/reference/calc_spp_frc_data.html +/reference/create_spp_aoh_data.html +/reference/create_spp_frc_data.html +/reference/create_spp_info_data.html +/reference/crosswalk_jung_lvl1_data.html +/reference/crosswalk_jung_lvl2_data.html +/reference/crosswalk_jung_plvl1_data.html +/reference/crosswalk_lumb_cgls_data.html +/reference/get_global_elevation_data.html +/reference/get_jung_lvl1_habitat_data.html +/reference/get_jung_lvl2_habitat_data.html +/reference/get_jung_plvl1_habitat_data.html +/reference/get_lumb_cgls_habitat_data.html +/reference/get_spp_habitat_data.html +/reference/get_spp_summary_data.html +/reference/get_spp_threat_data.html +/reference/index.html +/reference/is_gdal_calc_available.html +/reference/is_grass_available.html +/reference/is_iucn_rl_api_available.html +/reference/is_osgeo4w_available.html +/reference/iucn_habitat_codes_artificial.html +/reference/iucn_habitat_codes_introduced.html +/reference/iucn_habitat_codes_marine.html +/reference/iucn_habitat_codes_misc.html +/reference/iucn_habitat_codes_terrestrial.html +/reference/iucn_habitat_data.html +/reference/iucn_threat_data.html +/reference/plot_spp_aoh_data.html +/reference/plot_spp_frc_data.html +/reference/read_spp_range_data.html +/reference/simulate_spp_data.html +/reference/st_repair_geometry.html +/reference/system_gdal_version.html +/reference/terra_combine.html +/reference/terra_gdal_calc.html +/reference/terra_gdal_crop.html +/reference/terra_gdal_project.html +/reference/terra_gdal_rasterize.html + diff --git a/inst/doc/aoh.html b/inst/doc/aoh.html index 9a859f2c..0fb12be0 100644 --- a/inst/doc/aoh.html +++ b/inst/doc/aoh.html @@ -11,7 +11,7 @@ - + Getting started @@ -169,7 +169,7 @@

Getting started

-

2024-07-24

+

2024-08-05

@@ -282,10 +282,10 @@

Tutorial

## # A tibble: 4 × 5 ## id_no binomial seasonal path geometry ## <dbl> <chr> <int> <chr> <POLYGON [m]> -## 1 979 Alytes dickhilleni 1 /tmp/RtmpK4QWL… ((-105506.8 4465112, -10… -## 2 59448 Calotriton asper 1 /tmp/RtmpK4QWL… ((-238681 5029057, -2377… -## 3 4657 Chioglossa lusitanica 1 /tmp/RtmpK4QWL… ((-859201.6 4559278, -85… -## 4 58622 Rana iberica 1 /tmp/RtmpK4QWL… ((-849801.9 4614149, -84… +## 1 979 Alytes dickhilleni 1 /tmp/RtmpUfG7A… ((-105506.8 4465112, -10… +## 2 59448 Calotriton asper 1 /tmp/RtmpUfG7A… ((-238681 5029057, -2377… +## 3 4657 Chioglossa lusitanica 1 /tmp/RtmpUfG7A… ((-859201.6 4559278, -85… +## 4 58622 Rana iberica 1 /tmp/RtmpUfG7A… ((-849801.9 4614149, -84…

After generating the Area of Habitat data, we can import them.

# import the Area of Habitat data
 ## since the data for each species have a different spatial extent
@@ -340,7 +340,7 @@ 

Tutorial

We can see that the Area of Habitat data for each species are stored in separate spatial (raster) datasets with different extents. Although this is useful because it drastically reduces the total size of the data for each species, it can make it difficult to work with data for multiple species. To address this, we can use the terra_combine() function to automatically align and combine the spatial data for all species’ distributions into a single spatial dataset.

# combine raster data
 spp_aoh_rasters <- terra_combine(spp_aoh_rasters)
-
## |---------|---------|---------|---------|========                                          |---------|---------|---------|---------|========                                          |---------|---------|---------|---------|========                                          |---------|---------|---------|---------|=========================                                          
+
## |---------|---------|---------|---------|==========                                          |---------|---------|---------|---------|==========                                          |---------|---------|---------|---------|==========                                          |---------|---------|---------|---------|=====================                                          
# assign identifiers to layer names
 names(spp_aoh_rasters) <- paste0(
   "AOH_", spp_aoh_data$id_no, "_", spp_aoh_data$seasonal
@@ -353,10 +353,10 @@ 

Tutorial

## resolution : 100, 100 (x, y) ## extent : -914731, 318669, 4364377, 5066777 (xmin, xmax, ymin, ymax) ## coord. ref. : World_Behrmann -## sources : spat_4331713e3e6c0_275223.tif -## spat_43317560d309c_275223.tif -## spat_43317450ad47_275223.tif -## spat_433175218fc77_275223.tif +## sources : spat_d46e84c0f76ec_870120.tif +## spat_d46e81fcac4e9_870120.tif +## spat_d46e8f65840_870120.tif +## spat_d46e81afc02b7_870120.tif ## varnames : 979_1 ## 59448_1 ## 4657_1 @@ -381,11 +381,11 @@

Tutorial

axis.text = element_text(size = 6), strip.text = element_text(color = "white"), strip.background = element_rect(fill = "black", color = "black") - )
-
## |---------|---------|---------|---------|=========================================                                          
-
# display maps
-print(map)
-

+ ) + +# display maps +print(map)
+

Frequently asked questions

@@ -398,8 +398,8 @@

Frequently asked questions

Please open the .Renviron file on your computer (e.g., using usethis::edit_r_environ()). Next, please add the following text to the file (replacing the string with the token) and save the file:

IUCN_REDLIST_KEY="your_actual_token_not_this_string"

Please restart your R session. You should now be able to access the IUCN Red List API. To verify this, please try running the following R code and – assuming everything works correctly – you should see the current version of the IUCN Red List:

-
# verify access to IUCN Red List API
-rredlist::rl_version()
+
# verify access to IUCN Red List API
+rredlist::rl_version()

If these instructions did not work, please consult the documentation for the rredlist R package for further details.

  • Where can I find species range data for generating Area of Habitat data?

    Species range data can be obtained from the IUCN Red List (see Spatial Data Download resources). They can also be obtained from other data sources (see the question below for details).

  • diff --git a/inst/doc/customization.html b/inst/doc/customization.html index bf6ded2e..bcf04838 100644 --- a/inst/doc/customization.html +++ b/inst/doc/customization.html @@ -11,7 +11,7 @@ - + Customization @@ -169,7 +169,7 @@

    Customization

    -

    2024-07-24

    +

    2024-08-05

    @@ -237,7 +237,7 @@

    Tutorial

    geom_sf(data = spp_range_data, fill = "darkblue") + facet_wrap(~ id_no + seasonal) print(map)
    -

    +

    Next, we will import data to describe the species’ habitat preferences. Although such data would be automatically obtained from the IUCN Red List by default (using the get_spp_habitat_data() function), here we will import example data distributed with the package. As before, please note that these data were not obtained from the IUCN Red List, and were randomly generated. If you wish to use your own data, please ensure that they follow exactly the same conventions (e.g., column names, data types, and character values for the "suitability" and "season" columns).

    # find file path for species habitat preference data
     spp_habitat_path <- system.file(
    @@ -357,7 +357,7 @@ 

    Tutorial

    ## max value : 3260
    # visualize data
     plot(elevation_data, main = "Elevation data")
    -

    +

    Next, we will import habitat classification data. Although such data would be automatically imported by default (using the get_lumb_cgls_habitat_data() function), here we will import example data distributed with the package.

    # find file path for elevation data
     habitat_path <- system.file(
    @@ -380,7 +380,7 @@ 

    Tutorial

    ## max value : 1405
    # visualize data
     plot(habitat_data, main = "Habitat classification data")
    -

    +

    Critically, the elevation data and habitat classification data must have exactly the same spatial properties. This means they must have the same coordinate reference system, resolution, and spatial extent. If you are using elevation or habitat classification data that you have previously prepared yourself (or manually download from online sources), you may need to resample (or reproject) your data to ensure both datasets have the same spatial properties using a geographic information system (GIS). For example, data could be resampled using ESRI ArcGIS, QGIS, terra R package, or the gdalUtilities R package. We can verify that both of the elevation and habitat classification datasets have the same spatial properties using the following code.

    # verify that elevation and habitat classification data have same properties
     ## if we see TRUE, this means they have the same spatial properties.
    @@ -674,21 +674,21 @@ 

    Tutorial

    ## 15 3.4|5|14.5 3.4|5|14.5 182 ## elevation_upper xmin xmax ymin ymax path ## * <dbl> <dbl> <dbl> <dbl> <dbl> <chr> -## 1 942 -896631 -648631 4946077 5067077 /tmp/RtmpK4QWLo/670_2.tif -## 2 942 -417631 320369 4742077 5033077 /tmp/RtmpK4QWLo/670_3.tif -## 3 942 -527631 -312631 4664077 4840077 /tmp/RtmpK4QWLo/670_4.tif -## 4 907 -916631 39369 4328077 5070077 /tmp/RtmpK4QWLo/2072_1.tif -## 5 1020 -868631 320369 4304077 5070077 /tmp/RtmpK4QWLo/2374_1.tif -## 6 598 -794631 -305631 4334077 4678077 /tmp/RtmpK4QWLo/3667_1.tif -## 7 949 -863631 -8631 4400077 5062077 /tmp/RtmpK4QWLo/4421_1.tif -## 8 951 -916631 203369 4304077 5070077 /tmp/RtmpK4QWLo/4650_1.tif -## 9 974 -621631 -354631 4304077 4456077 /tmp/RtmpK4QWLo/5808_1.tif -## 10 974 -375631 -201631 4373077 4519077 /tmp/RtmpK4QWLo/5808_2.tif -## 11 974 -771631 -651631 4781077 4861077 /tmp/RtmpK4QWLo/5808_3.tif -## 12 974 -868631 275369 4406077 5058077 /tmp/RtmpK4QWLo/5808_4.tif -## 13 1069 -896631 -74631 4634077 5070077 /tmp/RtmpK4QWLo/6701_1.tif -## 14 991 -868631 291369 4304077 5044077 /tmp/RtmpK4QWLo/8110_1.tif -## 15 1183 -402631 183369 4624077 5000077 /tmp/RtmpK4QWLo/8644_1.tif +## 1 942 -896631 -648631 4946077 5067077 /tmp/RtmpUfG7A1/670_2.tif +## 2 942 -417631 320369 4742077 5033077 /tmp/RtmpUfG7A1/670_3.tif +## 3 942 -527631 -312631 4664077 4840077 /tmp/RtmpUfG7A1/670_4.tif +## 4 907 -916631 39369 4328077 5070077 /tmp/RtmpUfG7A1/2072_1.tif +## 5 1020 -868631 320369 4304077 5070077 /tmp/RtmpUfG7A1/2374_1.tif +## 6 598 -794631 -305631 4334077 4678077 /tmp/RtmpUfG7A1/3667_1.tif +## 7 949 -863631 -8631 4400077 5062077 /tmp/RtmpUfG7A1/4421_1.tif +## 8 951 -916631 203369 4304077 5070077 /tmp/RtmpUfG7A1/4650_1.tif +## 9 974 -621631 -354631 4304077 4456077 /tmp/RtmpUfG7A1/5808_1.tif +## 10 974 -375631 -201631 4373077 4519077 /tmp/RtmpUfG7A1/5808_2.tif +## 11 974 -771631 -651631 4781077 4861077 /tmp/RtmpUfG7A1/5808_3.tif +## 12 974 -868631 275369 4406077 5058077 /tmp/RtmpUfG7A1/5808_4.tif +## 13 1069 -896631 -74631 4634077 5070077 /tmp/RtmpUfG7A1/6701_1.tif +## 14 991 -868631 291369 4304077 5044077 /tmp/RtmpUfG7A1/8110_1.tif +## 15 1183 -402631 183369 4624077 5000077 /tmp/RtmpUfG7A1/8644_1.tif ## geometry ## * <MULTIPOLYGON [m]> ## 1 (((-744167.8 5065733, -744758.3 5065030, -745429.8 5064437, -745619 5064063,… @@ -728,7 +728,7 @@

    Tutorial

    # display maps print(map)
    -

    +

    Conclusion

    diff --git a/inst/scripts/aoh-data.R b/inst/scripts/aoh-data.R index d6a92189..fae8ad4c 100644 --- a/inst/scripts/aoh-data.R +++ b/inst/scripts/aoh-data.R @@ -1,6 +1,5 @@ # Initialization ## load packages -devtools::load_all() library(aoh) library(raster) library(terra) @@ -11,14 +10,16 @@ library(rappdirs) ## define available datasets input_file_options <- c( "amphibians" = "AMPHIBIANS.zip", - "birds" = "BOTW.7z", - "birds-part-1" = "BOTW.7z", - "birds-part-2" = "BOTW.7z", - "birds-part-3" = "BOTW.7z", - "birds-part-4" = "BOTW.7z", - "birds-part-5" = "BOTW.7z", - "birds-part-6" = "BOTW.7z", - "mammals" = "MAMMALS_TERRESTRIAL_ONLY.zip", + "birds" = "BOTW_2023_1.7z", + "birds-part-1" = "BOTW_2023_1.7z", + "birds-part-2" = "BOTW_2023_1.7z", + "birds-part-3" = "BOTW_2023_1.7z", + "birds-part-4" = "BOTW_2023_1.7z", + "birds-part-5" = "BOTW_2023_1.7z", + "birds-part-6" = "BOTW_2023_1.7z", + "mammals-land" = "MAMMALS_TERRESTRIAL_ONLY.zip", + "mammals-land-freshwater" = "MAMMALS_FRESHWATER.zip", + "mammals-land-marine" = "MAMMALS_MARINE_AND_TERRESTRIAL.zip", "reptiles" = "REPTILES.zip" ) @@ -45,22 +46,23 @@ assertthat::assert_that( input_file <- input_file_options[[cmd_args]] cli::cli_alert_info(paste0("processing file: ", input_file)) +### set geometry processing +if (isTRUE(startsWith(input_file, "BOTW"))) { + geometry_precision <- 1e10 +} else { + geometry_precision <- 1e6 +} + ### change this to the folder where the zip file is located input_dir <- rappdirs::user_data_dir("iucn-red-list-data") ### change this to where you want to save the outputs output_dir <- "~/aoh-data" -# Preliminary processing -## specify cache directory -cache_dir <- rappdirs::user_data_dir("aoh") - -## create cache directory if needed -cache_dir <- user_data_dir("aoh") -if (!file.exists(cache_dir)) { - dir.create(cache_dir, showWarnings = FALSE, recursive = TRUE) -} +## change this to where you want to catch IUCN Red List data +cache_dir <- paste0(output_dir, "/iucn-red-list-cache") +# Preliminary processing ## update output directory based on input data filename output_dir <- file.path( path.expand(output_dir), tools::file_path_sans_ext(basename(input_file)) @@ -69,6 +71,11 @@ if (!file.exists(output_dir)) { dir.create(output_dir, showWarnings = FALSE, recursive = TRUE) } +## create cache directory if needed +if (!file.exists(cache_dir)) { + dir.create(cache_dir, showWarnings = FALSE, recursive = TRUE) +} + # Main processing ## import data x <- read_spp_range_data(file.path(input_dir, input_file)) @@ -86,13 +93,17 @@ if (startsWith(cmd_args, "birds-part-")) { gc() ## exclude species in BirdLife data that are not on the IUCN Red List -if (identical(input_file, "BOTW.7z")) { +if (isTRUE(startsWith(toupper(input_file), "BOTW"))) { ### exclude species - exclude_ids <- c( - 22682860, 22700886, 22724592, 22683873, 61450351, 22735845, - 22709707, 155257132, 155257123, 22709791, 22723656 + #### N.B. all speciesin 2023-1 version of BirdLife data are present on + #### IUCN Red List so we don't need to exclude any species for this version + exclude_ids <- c() + id_column <- ifelse("sisid" %in% names(x), "sisid", "SISID") + assertthat::assert_that( + id_column %in% names(x), + msg = "can't identify id column (neither \"sisid\" or \"SISID\" present)" ) - x <- x[which(!x$SISID %in% exclude_ids), , drop = FALSE] + x <- x[which(!x[[id_column]] %in% exclude_ids), , drop = FALSE] ### garbage collection gc() } @@ -101,6 +112,7 @@ if (identical(input_file, "BOTW.7z")) { info_data <- create_spp_info_data( x = x, cache_dir = cache_dir, + geometry_precision = geometry_precision ) ## create Area of Habitat data @@ -110,7 +122,8 @@ result_data <- create_spp_aoh_data( cache_dir = cache_dir, engine = engine, n_threads = n_threads, - cache_limit = cache_limit + cache_limit = cache_limit, + rasterize_touches = TRUE ) # Exports @@ -120,3 +133,6 @@ saveRDS( file = file.path(dirname(output_dir), paste0("AOH_", out_name, ".rds")), compress = "xz" ) + +## session information +sessionInfo() diff --git a/inst/scripts/iucn-species-list.R b/inst/scripts/iucn-species-list.R new file mode 100644 index 00000000..0b7dfba0 --- /dev/null +++ b/inst/scripts/iucn-species-list.R @@ -0,0 +1,33 @@ +# Initialization +## load packages +library(rredlist) +library(readr) +library(dplyr) + +## define parameters +rl_categories <- c( + "DD", + "LC", + "NT", + "VU", + "EN", + "CR", + "EW", + "EX" +) + +# Main processing +## download data +results <- + lapply(rl_categories, function(x) { + y <- rl_sp_category(x)$result + y$category <- x + ## wait + Sys.sleep(2) + # return result + y + }) %>% + bind_rows() + +# Exports +write_csv(results, "iucn-species-list.csv") diff --git a/man/figures/README-map-1.png b/man/figures/README-map-1.png index 883fd8af..8002e047 100644 Binary files a/man/figures/README-map-1.png and b/man/figures/README-map-1.png differ