subset.curve_set | R Documentation |
Return subsets of curve sets which meet conditions.
## S3 method for class 'curve_set'
subset(x, subset, ...)
x |
A |
subset |
A logical expression indicating curves to keep. |
... |
Ignored. |
if(require("fda.usc", quietly=TRUE)) {
# Prepare data
data("poblenou")
Free <- poblenou$df$day.festive == 1 |
as.integer(poblenou$df$day.week) >= 6
MonThu <- poblenou$df$day.festive == 0 & poblenou$df$day.week %in% 1:4
Friday <- poblenou$df$day.festive == 0 & poblenou$df$day.week == 5
# Data as a curve_set
cset <- curve_set(r=0:23, obs=t(poblenou[['nox']][['data']]))
plot(subset(cset, MonThu))
plot(subset(cset, Friday))
plot(subset(cset, Free))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.