View source: R/effective_functions.r
rrPlot | R Documentation |
Produces a linear scatterplot array with marginal histograms. The plots have OLS regression lines and a 45-degree line.
rrPlot( formula, xlabels = NULL, ylab = NULL, data, return = c("grid", "grobs"), ptsize = 1, ptshape = 1, ptcol = "gray65" )
formula |
Formula giving the variables to be plotted. |
xlabels |
Vector of character strings giving the labs of variables to be used in place of the variable names. |
ylab |
Character string giving y-variable label to be used instead of variable name. |
data |
A data frame that holds the variables to be plotted. |
return |
A string identify what to return. If ‘grid’,
then a |
ptsize |
Size of points. |
ptshape |
Shape of points. |
ptcol |
Color of points. |
A cowplot
object.
data(wvs) library(MASS) lmod <- lm(secpay ~ gini_disp + democrat + log(pop), data=wvs) e1_m <- rlm(secpay ~ gini_disp + democrat + log(pop), data=wvs, method="M")$residuals e1_mm <- rlm(secpay ~ gini_disp + democrat + log(pop), data=wvs, method="MM")$residuals e1dat <- data.frame(OLS = lmod$residuals, M = e1_m, MM = e1_mm) rrPlot(OLS ~ M + MM, data=e1dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.