Description Usage Arguments Value Examples
This function produces a smoothed (theoretical) eCDF plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
data |
a dataframe containing the data. |
y |
column reference to determine exceedance entered as an object (without quotes). |
adj |
adjustment value for smoothing. Select values between 0 and 1. |
color_var |
optional a grouping variable entered as an object reference. |
title |
optional title for resulting plot. |
subtitle |
optional a subtitle for the resulting plot if required. |
compare |
optional logical value to output the true Empirical Cumulative Distribution Function with the smoothed function, providing a visual comparison. |
coord_flip |
optional to flip the X and Y axis for visual preference. |
plot_only |
optional when |
show_percent |
optional when |
Depending on the argument passed to plot_only
either a list object is returned when plot_only == FALSE
containing a grob object [["plot"]]
for plotting and a dataframe [["data"]]
for further analysis
. A single plot is returned when plot_only == TRUE
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | data(waves)
plt_a <- smooth_ecd(data = waves,
y = height_meters)
plot(plt_a)
plt_a <- smooth_ecd(data = waves,
y = height_meters,
plot_only = FALSE)
plot(plt_a[["plot"]])
# Add a grouping variable
library(dplyr)
plt_b <- smooth_ecd(data = waves %>%
mutate(hour = format(date_time, "%H")),
y = height_meters,
color_var = hour,
adj = 1,
title = "Wave Height Cumulative Distribution",
subtitle = "By Hour",
plot_only = FALSE)
# Access the list objects
plot(plt_b[["plot"]])
dat <- plt_b[["data"]]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.