rasterizeRange: Rasterize Species Data from Shapefile

View source: R/rasterizeRange.R

rasterizeRangeR Documentation

Rasterize Species Data from Shapefile

Description

Rasterize shapefile of multiple polygons to individual global rasters with a specific resolution

Usage

rasterizeRange(
  dsn = paste0(getwd(), "/IUCN/AMPHIBIANS.shp"),
  id = "binomial",
  resolution = 0.5,
  save = TRUE,
  touches = TRUE,
  extent = c(-180, 180, -90, 90),
  split = NA,
  name_split = c(1, 2),
  seasonal = NA,
  origin = NA,
  presence = NA,
  getCover = F,
  df = F,
  crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0",
  path = getwd()
)

Arguments

dsn

Path to one shapefile with multiple polygons or a list of files

id

character Character specifying the id column

resolution

integer Resolution in degrees

save

logical Should individual output be stored. Path to output folder can be specified under path

touches

logical If TRUE, all cells touched by lines or polygons are affected, not just those on the line render path, or whose center point is within the polygon.

extent

extent Extent of area that we are interested in.

split

character default is NA

name_split

integer Specifies which splits to use, default is c(1,2).

seasonal

integer 1 = Resident, 2 = Breeding Season, 3 = Non-breeding Season, 4 = Passage, 5 = Seasonal occurence uncertain.

origin

integer 1 = Native, 2 = Reintroduced, 3 = Introduced, 4 = Vagrant, 5 = Origin Uncertain.

presence

integer 1 = Extant, 2 = Probably Extant, 3 = Possibly Extant, 4 = Possibly Extinct, 5 = Extinct (post 1500), 6 = Presence Uncertain.

getCover

logical Calculate the percentage covered by a polygon rather than the presence of a species

df

logical Store the output as data.frame or not. If df=FALSE output will be stored as .tif files.

crs

character Define the output projection of your data.

path

character Path where individual output files are going to be stored.

Value

list of raster layers for each id with the given area shapefile

Examples

## Not run: 
r_amphibians <- rasterizeRange(dsn=paste0(getwd(), "/IUCN/AMPHIBIANS.shp"), id="binomial", 
resolution=0.5, seasonal=c(1,2), origin=1, presence=c(1,2), path=getwd())

## End(Not run)

RS-eco/rasterSp documentation built on Jan. 24, 2023, 12:06 a.m.