Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

prepareData

Prepare data for model fitting


Description

Simple helper function to prepare data for model fitting

Usage

prepareData(x, p, b, factors, xy=FALSE)

Arguments

x

Raster* object

p

presence points

b

background (or absence) points

factors

vectors indicating which variables are factors (using layer names or numbers)

xy

logical. If TRUE, the first two columns of the returned data.frame will be the coordinates of p and b (labeled 'x' and 'y')

Value

data.frame with nlayers(x)+1 columns and nrow(p) + nrow(b) rows. The first column, 'pb' indicates whether a record represents presence '1' or background '0' values. The other columns have the values from the Raster* object.

Author(s)

Robert J. Hijmans


dismo

Species Distribution Modeling

v1.3-3
GPL (>= 3)
Authors
Robert J. Hijmans, Steven Phillips, John Leathwick and Jane Elith
Initial release
2020-11-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.