fetch_mpa: Fetch MPA data by country from WDPA. Be patient with this -...

Description Usage Arguments Value Examples

View source: R/mpa.R

Description

Fetch MPA data by country from WDPA. Be patient with this - it can take a while.

Usage

1
2
3
4
5
6
7
8
fetch_mpa(
  name = "Cuba",
  path = rappdirs::user_data_dir("wdpar"),
  ext = ".gpkg",
  clean = TRUE,
  overwrite = TRUE,
  ...
)

Arguments

name

character, either accepted country name or ISO-3 code. You can also downlaod the global dataset using global.

path

character, the output path. We default to that specified by user_data_dir

ext

character, the file extension, by default we use ".gpkg"

clean

logical, if TRUE run the result through wdpa_clean

overwrite

logical, if TRUE overwrite exisiting datasets

...

other arguments for , see wdpa_fetch

Value

sf table of protected areas or NULL if an error is encountered

Examples

1
2
3
4
5
## Not run: 
x <- fetch_mpa(name = 'Cuba')
plot((x %>% dplyr::filter(MARINE == "1"))['REP_AREA'])

## End(Not run)

BigelowLab/mpatools documentation built on Jan. 20, 2022, 3:46 p.m.