sample_interval | R Documentation |
Sample variables by interval
sample_interval(.data, pos, breaks, fun = mean, ...)
.data |
(data.frame) Variables to sample. |
pos |
(numeric) |
breaks |
(numeric) Sorted (weakly) increasingly. |
fun |
(function|character) Sampling function |
... |
Additional arguments passed to |
df <- data.frame(
t = as_time(0:9),
x = 0:9,
y = 10:19
)
breaks <- as_time(c(0,5,10))
sample_interval(df[, c("x", "y")], df$t, breaks, fun = mean, na.rm = TRUE)
sample_interval(df[, c("x", "y")], df$t, breaks, fun = max, na.rm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.