subset.curve_set: Subsetting curve sets

View source: R/curve-set.r

subset.curve_setR Documentation

Subsetting curve sets

Description

Return subsets of curve sets which meet conditions.

Usage

## S3 method for class 'curve_set'
subset(x, subset, ...)

Arguments

x

A curve_set object.

subset

A logical expression indicating curves to keep.

...

Ignored.

Examples

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))
}

GET documentation built on Sept. 11, 2024, 5:46 p.m.