select_times: Select timerange

Description Usage Arguments Value Methods (by class) Author(s) See Also Examples

View source: R/data_selection.R

Description

Generic function for selecting specific time ranges from a given dataset. Input can be a dataframe, or an object of class eeg_data, eeg_epochs, or eeg_evoked. Note this finds the closest times to those specified, so the time range returned may be slightly longer or shorter than that requested.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
select_times(data, ...)

## Default S3 method:
select_times(data, time_lim = NULL, ...)

## S3 method for class 'eeg_data'
select_times(data, time_lim = NULL, df_out = FALSE,
  ...)

## S3 method for class 'eeg_epochs'
select_times(data, time_lim, df_out = FALSE, ...)

## S3 method for class 'eeg_evoked'
select_times(data, time_lim, df_out = FALSE, ...)

## S3 method for class 'eeg_tfr'
select_times(data, time_lim = NULL, df_out = FALSE,
  ...)

Arguments

data

Data from which to select

...

Further arguments passed to or from other methods.

time_lim

A character vector of two numbers indicating the time range to be selected e.g. c(min, max)

df_out

Returns a data frame rather than an object of the same type that was passed in

Value

Data frame with only data from within the specified range.

eeg_data object

Methods (by class)

Author(s)

Matt Craddock, matt@mattcraddock.com

See Also

select_elecs and select_epochs

Other Data selection functions: select_elecs

Examples

1
2
3
4
## Select timepoints from -.1 to .3
demo_epochs
short_epochs <- select_times(demo_epochs, time_lim = c(-.1, .3))
short_epochs

neuroconductor-devel-releases/eegUtils documentation built on May 5, 2020, 3:49 a.m.