Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add read abiotic ranges function #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export(n2khab_options)
export(read_GRTSmh)
export(read_GRTSmh_base4frac)
export(read_GRTSmh_diffres)
export(read_abiotic_ranges)
export(read_admin_areas)
export(read_ecoregions)
export(read_env_pressures)
Expand Down
98 changes: 98 additions & 0 deletions R/read_abiotic_ranges.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#' Read favourable abiotic ranges for vegetation types of Flanders
#'
#' The function will download the data from a Zenodo deposit to a temporary
#' folder and read the data back into the current R session.
#' The original source for the data is the report 10.21436/inbor.19362510.
#'
#' @param doi A doi string. The default DOI string will resolve to the latest
#' version of the data in the Zenodo deposit.
#' If you want a specific version, please consult the Zenodo deposits web page
#' to obtain the version-specific DOI.
#'
#' @return A `data.frame`.
#'
#' The table contains 950 rows and 19 columns.
#' The first row is a column header and represents the variable name.
#' The following list provides a brief description for each variable:
#'
#' `Habitatsubtype`: Natura 2000 (sub)type habitat code
#'
#' `Subtype`: code/name of possible vegetation variants.
#' For aquatic types, the Flemish water type is listed
#' (according to Water Framework Directive-Integrated Water Policy Objectives)
#'
#' `Milieucompartiment`: soil, groundwater, inundation water (flooding with
#' water of external origin), water column/surface water, air
#'
#' `Variabele`: name of the environmental variable.
#'
#' `Afkorting`: abbreviation used for the environmental variable
#'
#' `Eenheid`: unit used for the environmental variable
#'
#' `Toetswijze bepaling`: for aquatic types, measurements are first summarized
#' using certain statistics such as percentiles, mean, etc. (in accordance with
#' Water Framework Directive-Integrated Water Policy Objectives)
#'
#' `Teken`: range type
#' - LL-UL: lower limit-upper limit
#' - 10-90 perc: 10-90 percentile values
#' - min-max: minimum - maximum
#' - < - >: less than - greater than
#'
#' `Abiotisch bereik`: overall measurement range of an environmental variable
#' within which a habitat type can function sustainably:
#' - `Abiotisch bereik`: range as text field
#' - `Waarde1` - `Waarde2`: lower and upper limit as text field
#' - `WaardeNum1` - `WaardeNum2`: lower and upper limit as numerical value
#' (where conversion was possible)
#'
#' `N gunstig`: number of test plots in favorable conservation status used for
#' the calculation. The definition of favorable conservation status is based on
#' Oosterlynck et al. (2020, version 3).
#'
#' `Status`: source and method by which the range was derived:
#' - Dp: ranges calculated with INBO data, prediction intervals, local
#' conservation status (LCS) known
#' - Dt: ranges determined using Titan method (Baker & King 2010), LCS unknown
#' - Dk: ranges calculated with INBO data, quantiles, insufficient data to
#' calculate prediction intervals
#' - Lg: ranges derived from literature (LCS clearly indicated)
#' - Lk: ranges derived from literature (LCS derived, based on site
#' characteristics)
#'
#' `Referentie`: references based on which the abiotic range was determined
#'
#' `Opmerking`: remarks
#'
#' `Wijziging`: whether this record has been modified compared to Van Calster
#' et al. (2020) and how
#'
#' @export
#'
#' @references
#' - Van Calster H., Cools N., De Keersmaeker L., Denys L., Herr C., Leyssen A.,
#' Provoost S., Vanderhaeghe F., Vandevoorde B., Wouters J. en M. Raman (2020).
#' Gunstige abiotische bereiken voor vegetatietypes in Vlaanderen. Rapporten van
#' het Instituut voor Natuur- en Bosonderzoek 2020 (44). Instituut voor Natuur-
#' en Bosonderzoek, Brussel. DOI: doi.org/10.21436/inbor.19362510D
#' - Oosterlynck P., De Saeger S., Leyssen A., Provoost S., Thomaes A.,
#' Vandevoorde B., Wouters J., & Paelinckx D. (2020). Criteria voor de
#' beoordeling van de lokale staat van instandhouding van de Natura2000
#' habitattypen in Vlaanderen. Rapporten van het Instituut voor Natuur- en
#' Bosonderzoek 2020 (27). Instituut voor Natuur- en Bosonderzoek, Brussel.
#' DOI: doi.org/10.21436/inbor.14061248
#'
#' @examples
#' \dontrun{
#' far <- read_abiotic_ranges()
#' }
read_abiotic_ranges <- function(doi = "10.5281/zenodo.10533791") {
td <- tempdir()
download_zenodo(doi = doi, path = td, quiet = TRUE)
file <- list.files(path = td, pattern = "txt$")
far <- read.delim(
file = file.path(td, file), header = TRUE, sep = "\t", dec = ","
)
return(far)
}
97 changes: 97 additions & 0 deletions man/read_abiotic_ranges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading