boxplot | R Documentation |
boxplot(
df,
x = "location_id",
y = "analysis_result",
lt_measure = "lt_measure",
group_var = "param_name",
coef = 1.5,
scale_y_trans = "identity",
show_points = FALSE,
fill = NULL,
notch = FALSE,
plot_ci = FALSE,
limit1 = NULL,
limit2 = NULL,
pnt = 2,
short_name = FALSE,
coord_flip = FALSE,
legend_title = NULL
)
df |
groundwater data in tidy format |
x |
column to be used for the x axis, default is location |
y |
column to be used for the y axis, default is analysis result |
lt_measure |
column for >, or < identifier |
group_var |
the name of column used for constituents. Default is "param_name" |
coef |
length of the whiskers as multiple of the IQR. Defualt is 3. |
scale_y_trans |
type of transformation to use for y scale. Default is "identity". Built-in transformations include "asn", "atanh", "boxcox", "exp", "identity", "log", "log10", "log1p", "log2", "logit", "probability", "probit", "reciprocal", "reverse" and "sqrt". |
show_points |
plot the individual points using ggbeeswarm. |
fill |
column used to fill the variable |
notch |
TRUE/FALSE plot a notched boxplot. The notches (if requested) extend to +/-1.58 IQR/sqrt(n) |
plot_ci |
add boostrapped 95 \itemlimit1column to be used to draw horizontal line \itemlimit2column to be used to draw a second horizontal line \itempntsize of points \itemshort_nameIf TRUE the constituent name will be abbreviated \itemcoord_flipIf TRUE the axes are flipped \itemlegend_titleLegend title for fill variable |
Boxplot function data(gw_data) gw_data %>% filter(param_name %in% c("Chloride, total", "Sulfate, total"), location_id %in% c("MW-1", "MW-2", "MW-3", "MW-4", "MW-5", "MW-6", "MW-7", "MW-8")) %>% mutate(gradient = if_else(location_id %in% c("MW-1", "MW-2", "MW-3", "MW-5"), "upgradient", "downgradient")) %>% boxplot(., fill = "gradient")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.