barplot_agg | R Documentation |
Creates a bar plot with aggregated variable on y-axis and labels of aggregation periods on x-axis.
barplot_agg(
x,
var,
interval = NULL,
nTicks = NULL,
days = x$days,
names.arg = x$Intervals
)
x |
A data frame with column names. |
var |
A character string. An |
interval |
A character string. Specifies |
nTicks |
An integer. Number of x-axis ticks to plot. If |
days |
A numeric vector. Number of days (or their fractions) aggregated
within each time interval described by |
names.arg |
A character vector. Names of each aggregation period
corresponding to |
barplot
set.seed(123)
n <- 17520 # number of half-hourly records in one non-leap year
tstamp <- seq(c(ISOdate(2021,3,20)), by = "30 mins", length.out = n)
x <- data.frame(timestamp = tstamp, H = rf(n, 1, 2, 1))
aggm <- agg_sum(x, "%b-%Y")
barplot_agg(aggm, var = "H_sum", "monthly")
aggw <- agg_sum(x, "%W_%Y")
barplot_agg(aggw, var = "H_sum", "weekly")
aggd <- agg_sum(x, "%Y-%m-%d")
barplot_agg(aggd, var = "H_sum", "daily")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.