selectdata: Select Data

View source: R/selectdata.R

selectdataR Documentation

Select Data

Description

Select data from a ctd object.

Usage

selectdata(
  ctd_obj,
  seconds = NULL,
  samples = NULL,
  signals = NULL,
  add.t = FALSE
)

Arguments

ctd_obj

object of class 'ctd' containing continuous time domain data.

seconds

character string representing an expression to select the specified seconds from the data; can only used when ctd_obj contains a 't' variable alongside the signals.

samples

samples to select from the data; must be between 1 and npts(ctd_obj).

signals

signals to select from the data. Either a vector of numeric values between 1 and ns(ctd_obj), or a character vector with sensors names from colnames(ctd_obj).

add.t

logical indicating whether to add or renew the time variable t. If TRUE and ctd_obj did not contain a variable t, it is added. If it did contain a variabe t, it is updated starting at 0. If FALSE (default), an existing variable t is left unchanged.

Value

A ctd object containing the selected data.

Author(s)

Geert van Boxtel, G.J.M.vanBoxtel@gmail.com

Examples


data(EEGdata)
sel <- selectdata(EEGdata, seconds = 'which(t < 3)')
sel <- selectdata(EEGdata, samples = 1:600)
sel <- selectdata(EEGdata, signals = 1:28)


gjmvanboxtel/eegr documentation built on May 20, 2023, 4:26 a.m.