plotResponse_ggplot2: Plot species probability of occurrence along with the...

Description Usage Arguments Value See Also

View source: R/plotResponse_ggplot2.R

Description

For the coefs argument, use an argument like coefs = list(elevation = c(0.5, 0.1, 0.3)) for a response of the form logit(prob_of_occurrence) = 0.5 + 0.1*elevation + 0.3*(elevation^2). Use a 0 for the coefficient of the polynomial term to produce a straght-line response.

Usage

1
plotResponse_ggplot2(sp_name, df, pred_1, pred_2, resp, coefs)

Arguments

sp_name

character string giving the species name

df

data frame holding values for all predictor variables, principal components, and responses (logit(p) and probability) for each site in the raster

pred_1

character string giving column name of predictor variable 1

pred_2

character string giving column name of predictor variable 2

resp

- character string giving column name of the response variable (e.g. probability of occurrence)

coefs

- a named list giving a numeric vector with the coefficients for the linear predictors, including the intercept and first and second degree polynomials for each of the predictor variables. The name is the same as the name of the predictor variable, and the values are numeric coefficients.

Value

This function prints to the graphics device rather than returning an object.

See Also

my code is based on this: https://stackoverflow.com/questions/17370853/align-ggplot2-plots-vertically/17371177#17371177


wgaul/wgutil documentation built on June 1, 2020, 3:39 a.m.