response: Get partial response data

partialResponseR Documentation

Get partial response data

Description

Get partial response data.

Usage

partialResponse(model, data, var=NULL, rng=NULL, nsteps=25, plot=TRUE, nr, nc, ...)
partialResponse2(model, data, var1, var2, var2levels, rng=NULL, nsteps=25, ...)

Arguments

model

a model object

data

data.frame with data for all model variables

var

character or positive integer to identify the variable(s) of interest in data. If this is NULL, the partial response is computed for all variables

var1

character or positive integer to identify the variable of interest in data

var2

character. A second variable of interest

var2levels

character. The levels of the second variable to consider

rng

optional vector of two numbers to set the range or the variable

nsteps

positive integer. Number of steps to consider for the variable

plot

logical. If TRUE, the responses are plotted

nc

positive integer. Optional. The number of columns to divide the plotting device in (when plotting multiple variables)

nr

positive integer. Optional. The number of rows to divide the plotting device in (when plotting multiple variables)

...

model specific additional arguments passed to predict

Value

list (invisible if plot=TRUE)

Examples

fsp <- system.file("/ex/bradypus.csv", package="predicts")
occ <- read.csv(fsp)[,-1]
f <- system.file("ex/bio.tif", package="predicts")
preds <- rast(f)[[c(1,7,9)]]
v <- extract(preds, occ, ID=FALSE)

bc <- envelope(v)

pr <- partialResponse(bc, data=v, var=c("bio1", "bio12"), nsteps=30)
str(pr)

predicts documentation built on Oct. 7, 2024, 9:06 a.m.