df2rast {phyloraster}R Documentation

Transform a data.frame to raster

Description

The function transforms a data.frame or a matrix of presence- absence in a raster of distribution.

Usage

df2rast(x, CRS = "+proj=longlat +datum=WGS84", ...)

Arguments

x

data.frame. A data.frame or matrix with species names in columns and sites in rows. The first two columns must provide longitude and latitude, respectively.

CRS

character. Description of the Coordinate Reference System (map projection) in PROJ.4.

...

additional arguments to be passed passed down from a calling function.

Value

SpatRaster

Examples


dat <- phyloraster::load.data.rosauer()
df2rast(dat$presab, crs = "+proj=longlat +datum=WGS84 +ellps=WGS84
+towgs84=0,0,0")


[Package phyloraster version 2.1.0 Index]