boxplot: Boxplot function

View source: R/boxplot.R

boxplotR Documentation

Boxplot function

Usage

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
)

Arguments

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

\item

limit1column to be used to draw horizontal line

\item

limit2column to be used to draw a second horizontal line

\item

pntsize of points

\item

short_nameIf TRUE the constituent name will be abbreviated

\item

coord_flipIf TRUE the axes are flipped

\item

legend_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")


jentjr/gwstats documentation built on Jan. 12, 2024, 9:40 p.m.