Package 'rN2000'

Title: Package for downloading, querying and processing of Natura 2000 data
Description: This package provides functionalities to download, process and visualize Natura 2000 data. Functions allow the filtering, conversion and exporting of critical habitat and species data.
Authors: Martin Jung [aut, cre] , Matthew Lewis [aut]
Maintainer: Martin Jung <[email protected]>
License: CC BY 4.0 + file LICENSE
Version: 0.1
Built: 2025-03-13 04:17:38 UTC
Source: https://github.com/iiasa/rN2000

Help Index


100-km grid of Europe

Description

A grid of Europe at 100-km resolution in EPSG 3035. Based on FAO GAUL level 0 boundary polygons.

Usage

europe_100km

Format

A sf polygon.

CellCode

code for individual cells

EofOrigin

distance East of the data origin(centroid) in m

NfOrigin

distance North of the data origin(centroid) in m

Author(s)

European Environment Agency (EEA)

Source

https://www.eea.europa.eu/data-and-maps/data/eea-reference-grids-2


10-km grid of Europe

Description

A grid of Europe at 10-km resolution in EPSG 3035. Based on FAO GAUL level 0 boundary polygons.

Usage

europe_10km

Format

A sf polygon.

CellCode

code for individual cells

EofOrigin

distance East of the data origin(centroid) in m

NfOrigin

distance North of the data origin(centroid) in m

Author(s)

European Environment Agency (EEA)

Source

https://www.eea.europa.eu/data-and-maps/data/eea-reference-grids-2


European country administrative boundaries

Description

Natural Earth data at scale = 110 for countries within a European Bounding Box. Obtained through the rnaturalearth package at scale = 110. Reprojected to ETRS89-extended / LAEA Europe and clipped to a bounding box around Europe using the internal N2000:::get_EuropeanCountries() function.

Usage

europe_countries_lowres

Format

sf polygons.

Author(s)

Natural Earth

Source

https://www.naturalearthdata.com/downloads/


European country administrative boundaries

Description

Natural Earth data at scale = 50 for countries within a European Bounding Box. Obtained through the rnaturalearth package at scale = 50. Reprojected to ETRS89-extended / LAEA Europe and clipped to a bounding box around Europe using the internal N2000:::get_EuropeanCountries() function.

Usage

europe_countries_midres

Format

sf polygons.

Author(s)

Natural Earth

Source

https://www.naturalearthdata.com/downloads/


Create a habitat subset from the Natura 2000 data

Description

Create a habitat subset from the Natura 2000 data

Usage

n2000_filterHabitats(x, name)

Arguments

x

The character file path to the Natura 2000 geopackage

name

The character name of the habitat

Value

A sf object with the Natura 2000 sites containing this habitat

Author(s)

Martin Jung

Matt Lewis

Examples

## Not run: 
n2000_filterHabitats('/filepath/Natura2000_end2019.gpkg', name = 'Mountain hay meadows')

## End(Not run)

Create a species subset from the Natura 2000 data

Description

Create a species subset from the Natura 2000 data

Usage

n2000_filterSpecies(x, name, option, check.name = F)

Arguments

x

The character file path to the Natura 2000 geopackage

name

The character latin name of a focal species

option

The character type of data to return. Options are "PO" ('presence only' - sites where the species is present), "PA" ('presence absence' - sites where the species is present or absent), or "abundance".

check.name

logical Check whether the supplied name exists in the Natura 2000 data? Defaults to FALSE.

Value

A sf object with the Natura 2000 sites containing this species

Author(s)

Martin Jung

Matt Lewis

Examples

## Not run: 
n2000_filterSpecies('/filepath/Natura2000_end2019.gpkg', name = 'Asio otus')

## End(Not run)

Load and reformat Natura 2000 definitions to a list.

Description

Load and reformat Natura 2000 definitions to a list.

Usage

n2000_format_definitions(x)

Arguments

x

A ['character'] file path to the Natura 2000 data definitions file.

Author(s)

Matt Lewis

Martin Jung


Checks and attempts to fix erroneous species names from Natura 2000 data

Description

Uses the taxize package to look-up and (hopefully) fix incorrect species names.

Usage

n2000_format_species(x, overwrite = T, verbose = F, ...)

Arguments

x

A character directory to the Natura 2000 csv files (i.e. containing 'Natura2000_end2019_HABITATS.csv'). Or a character file path to the Natura 2000 geopackage file ('Natura2000_end2019.gpkg').

overwrite

A logical input - should the Natura 2000 data be overwritten with the fixed names? If no, only an internal R object is returned. Defaults to TRUE.

verbose

A logical input. Be chatty? Defaults to FALSE.

...

Other parameters passed on to taxize::tax_name() or taxize::synonyms()

Author(s)

Matt Lewis


Set or download the N2000 database in csv format to a given folder

Description

Set or download the N2000 database in csv format to a given folder

Usage

n2000_getCSV(
  folder,
  year = "2019",
  force = FALSE,
 
    nlink = "https://www.eea.europa.eu/data-and-maps/data/natura-11/natura-2000-tabular-data-12-tables/natura-2000-comma-separated-values-files/at_download/file"
)

Arguments

folder

A ['character'] directory path to download the Natura 2000 data set to. Automatic checks to see if the data already exist in the folder (can be overridden by specifying 'force = T').

year

(optional). The ['character'] year version of the Natura 2000 data set to check if it already exists. Defaults to the most recently available version (2019).

force

(optional). ['logical'] should a new download be forced even if data already exists in the directory? Defaults to 'FALSE'.

nlink

(normally not altered). The ['character'] direct download link for Natura 2000.

Author(s)

Martin Jung

Matt Lewis

Examples

## Not run: 
n2000_getCSV(folder = 'myfolder', year = "2019")

## End(Not run)

Download Natura 2000 definitions

Description

Download Natura 2000 definitions

Usage

n2000_getDefinitions(
  folder,
  year = "2019",
  force = FALSE,
 
    nlink = "https://www.eea.europa.eu/data-and-maps/data/natura-11/table-definitions/table-definitions-xls-file/at_download/file"
)

Arguments

folder

A ['character'] directory path to download the Natura 2000 data definitions to. Automatically checks to see if the data already exist in the folder (can be overridden by specifying 'force = T').

year

(optional). The ['character'] year version of the Natura 2000 data set to check if it already exists. Defaults to the most recently available version (2019).

force

(optional). ['logical'] should a new download be forced even if data already exists in the directory? Defaults to 'FALSE'.

nlink

(normally not altered). The ['character'] direct download link for Natura 2000 definitions file.

Author(s)

Matt Lewis

Martin Jung


Set or download the N2000 database in geopackage format to a given folder

Description

Set or download the N2000 database in geopackage format to a given folder

Usage

n2000_getGPGK(
  folder,
  year = "2019",
  force = FALSE,
  nlink = "https://cmshare.eea.europa.eu/s/GkqdcbbsYmmBSEQ/download"
)

Arguments

folder

A ['character'] directory path to download the Natura 2000 data set to. Automatic checks to see if the data already exist in the folder (can be overridden by specifying 'force = T').

year

(optional). The ['character'] year version of the Natura 2000 data set to check if it already exists. Defaults to the most recently available version (2019).

force

(optional). ['logical'] should a new download be forced even if data already exists in the directory? Defaults to 'FALSE'.

nlink

(normally not altered). The ['character'] direct download link for Natura 2000.

Author(s)

Martin Jung

Matt Lewis

Examples

## Not run: 
n2000_getGPKG(folder = 'myfolder', year = "2019")

## End(Not run)

Extract information from Natura 2000 sites within a target area of interest by means of spatial intersection.

Description

Extract Natura 2000 site information which overlap specified spatial locations.

Usage

n2000_intersect(n2000_file, target_areas, byid = T, enclosed = F)

Arguments

n2000_file

['character'] or ['object'] The file path to the Natura2000 geopackage. Alternatively the name of the loaded geopackage in the environment.

target_areas

['character'] or ['object'] The file path to the spatial polygon(s) for the area of interest. Must be readable by sf::st_read(). Alternatively the name of the loaded spatial data in the environment.

byid

['logical']. Should data be extracted for each target area (TRUE) or should they be merged first (FALSE)? Defaults to TRUE.

enclosed

['logical']. Should Natura 2000 sites only be included if they are fully enclosed by the target area? Defaults to FALSE.

Details

If the CRS of the target_areas does not match that of the Natura 2000 data, the target_areas are first reprojected.

Author(s)

Matt Lewis


Map Natura 2000 sites using WMS services

Description

N.b. This function requires the leaflet, and leaflet.extras2 packages to be installed and a functioning internet connection.

Usage

n2000_mapwms(title = "N2000", clng = NA, clat = NA, czoom = NA)

Arguments

title

The [‘character'] title of the WMS layer to be rendered. Options are: ’N2000', 'CDDA', and 'N2000_centroids'. Defaults to 'N2000'. See details.

clng

The ['numeric'] centre-point longitude coordinate of the field of view. See details.

clat

The ['numeric'] centre-point latitude coordinate of the field of view. See details.

czoom

The ['numeric'] zoom level to use. See details.

Details

‘title' has three options: ’N2000' to render Natura 2000 sites, 'CDDA' to render sites listed on the Common Database on Designated Areas (i.e. nationally designated areas) or 'N2000_centroids' to render only the centroids of the Natura 2000 sites.

The default field of view for either title = "N2000" or title = "CDDA" focuses on the Schlosspark in Laxenburg, Austria. This is arbitrary, and does not by any means reflect any biases on the parts of the authors. The default for title = "N2000_centroids" gives view of most of Europe.

Author(s)

Martin Jung

Matt Lewis

Examples

## Not run: 
n2000_mapwms()

## End(Not run)

Plot Natura 2000 data

Description

Wrapper around ggplot for convenience plotting with optional grid or administrative boundaries. Requires ggplot2 to be installed.

Usage

n2000_plot(x, option, borders = "midres", grid = F, sea = T)

Arguments

x

A sf object to plot.

option

The character type of data to plot. Options are "PO" ('presence only' - sites where the species is present), "PA" ('presence absence' - sites where the species is present and absent), "abundancelow" (the lower bound of abundance), "abundancehigh" (the higher bound of abundance), or "abundancemid" (the arithmetic mean of the upper and lower population bounds).

borders

(optional) A character input - should country borders be plotted? Options are "no", "lowres", "midres", "highres". Defaults to "midres", which, along with lowres is included in the package data. "highres" is first retrieved via the rnaturalearth package.

grid

(optional) A logical input. Should a grid be added too? Defaults to FALSE.

sea

(optional) A logical input. Should the sea be coloured in? Defaults to TRUE.

Author(s)

Matt Lewis


Show N2000 database definitions

Description

Show N2000 database definitions

Usage

n2000_showdefinitions(table = NULL)

Arguments

table

(optional). Table of the definitions (optional)

Author(s)

Martin Jung

Examples

## Not run: 
def_list <- n2000_getdefinitions()
def_list$HABITATS

## End(Not run)

Prepares a target species multipolygon feature for modelling using

Description

Prepares a target species multipolygon feature for modelling using

Usage

n2000_SpatialSpecies(
  species,
  metric = "pa",
  abundance_bound = "UPPERBOUND",
  what = "polygon",
  ref_grid = "1km"
)

Arguments

species

A data.frame obtained via the n2000_filterSpecies function

metric

How is biodiversity encoded in the output. As presence only ('po'), presence absence ('pa') or a population estimate ('abundance')

abundance_bound

Which estimate to use for metric option 'abundance'. Default is 'UPPERBOUND'

what

What should be created. Possible options ('polygon','raster')

ref_grid

Which European reference grid to use. Default is '1km'

Value

A spatial object of the respective species. The

Author(s)

Martin Jung

Examples

## Not run: 
species <- n2000_species('/media/martin/data/EuropeanBiodiversityData/N2000/Natura2000_end2019.gpkg',
                    sname = 'Asio otus')
o <- n2000_SpatialSpecies(species, 'Asio_otus', metric = 'pa', what = 'raster' )
plot(o)

## End(Not run)

Get list of unique habitat names from Natura 2000 checklists

Description

Get list of unique habitat names from Natura 2000 checklists

Usage

n2000_unique_habitats(x)

Arguments

x

A [‘character'] directory to the Natura 2000 csv files (i.e. containing ’Natura2000_end2019_HABITATS.csv'). Or a [‘character'] file path to the Natura 2000 geopackage file (’Natura2000_end2019.gpkg').

Details

Works with either geopackage (.gpkg) or csv (.csv) file extensions of downloaded data.

If you haven't downloaded the data yet, see 'rN2000::n2000_getCSV()' or 'rN2000::n2000_getGPKG()'

Value

A vector of habitat names.

Author(s)

Matt Lewis


Get list of unique species names from Natura 2000 checklists

Description

Get list of unique species names from Natura 2000 checklists

Usage

n2000_unique_species(x)

Arguments

x

A [‘character'] directory to the Natura 2000 csv files (i.e. containing ’Natura2000_end2019_SPECIES.csv'). Or a [‘character'] file path to the Natura 2000 geopackage file (’Natura2000_end2019.gpkg').

Details

Works with either geopackage (.gpkg) or csv (.csv) file extensions of downloaded data.

If you haven't downloaded the data yet, see 'rN2000::n2000_getCSV()' or 'rN2000::n2000_getGPKG()'

Value

A vector of species binomial names.

Author(s)

Matt Lewis