plotRespVsPred: Plot Correlations of Predictors vs. a Response

View source: R/plotRespVsPred.r

plotRespVsPredR Documentation

Plot Correlations of Predictors vs. a Response

Description

Takes a response variable (e.g., a macroinvertebrate or fish IBI) and plots it against a number of predictor variables.

Usage

plotRespVsPred(dfm, resp, pred)

Arguments

dfm

the dataset containing the predictor and response variables

resp

the name of the response variable within the data frame, as a string

pred

a vector of the column numbers of the predictors or the names as strings

Details

Creates faceted scatterplots with each predictor as a facet, the correlation coefficient plotted in the corner, and the facets sorted in decreasing correlation strength.

Value

Faceted scatterplots of each predictor vs. the response

Examples

plotRespVsPred(mtcars, 'mpg', c('hp', 'wt', 'disp'))

PDXChris/pmtools documentation built on July 18, 2024, 7:32 a.m.