Arguments:
regression_plot(formula, data, main = NULL, B = 1000, shade = TRUE,
shade.alpha = 0.1, spag = FALSE, mweight = TRUE, show.lm = FALSE,
show.median = TRUE, median.col = "white", show.CI = FALSE,
method = loess, bw = FALSE, slices = 200,
palette = colorRampPalette(c("#FFEDA0", "#DD0000"), bias = 2)(20),
ylim = NULL, quantize = "continuous", ...)
formula
data
figure title
number bootstrapped smoothers
plot the shaded confidence region?
shade.alpha: should the CI shading fade out at the edges? (by reducing alpha; 0 = no alpha decrease, 0.1 = medium alpha decrease, 0.5 = strong alpha decrease)
plot spaghetti lines?
should the median smoother be visually weighted?
should the linear regresison line be plotted?
show median smoother
median color
should the 95% CI limits be plotted?
the fitting function for the spaghettis; default: loess
define a default b/w-palette (TRUE/FALSE)
number of slices in x and y direction for the shaded region. Higher numbers make a smoother plot, but takes longer to draw. I wouldn'T go beyond 500
provide a custom color palette for the watercolors
restrict range of the watercoloring
either "continuous", or "SD". In the latter case, we get three color regions for 1, 2, and 3 SD (an idea of John Mashey)
further parameters passed to the fitting function, in the case of loess, for example, "span = .9", or "family = 'symmetric'"
Returns:
ggplot2 object
See citation("microbiome")
# NOT RUN {
library(dplyr); library(RColorBrewer);
library(ggplot2); data(iris);
p <- regression_plot(Sepal.Length ~ Sepal.Width, iris)
# }
Run the code above in your browser using DataLab