Description Usage Arguments Value See Also
View source: R/plotResponse_ggplot2.R
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.
1 | plotResponse_ggplot2(sp_name, df, pred_1, pred_2, resp, coefs)
|
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. |
This function prints to the graphics device rather than returning an object.
my code is based on this: https://stackoverflow.com/questions/17370853/align-ggplot2-plots-vertically/17371177#17371177
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.