Learn R Programming

Epoch (version 1.0.3)

crop: Methods for Epoch class

Description

Truncating iEEG data to a specific time range.

Usage

crop(x, start, end, ...)

# S4 method for Epoch crop(x, start, end, checkTimeRange = TRUE)

Value

clip the time range of the Epoch object

Arguments

x

An Epoch object

start

Numeric value specifying start of new time range

end

Numeric value specifying end of new time range

...

Not used

checkTimeRange

Logical, whether to check the validity of the time range. This includes checking if the time range is empty, if start is greater than end, and if start or end are out of bounds. Default is TRUE.

See Also

Other Epoch methods: coltimes(), plot,Epoch,missing-method, resample(), show,Epoch-method

Examples

Run this code
# Create an Epoch object
epoch_data <- matrix(rnorm(1000), nrow = 10)
rownames(epoch_data) <- paste0("Electrode_", 1:10)
epoch <- Epoch(epoch_data, startTime = 0, samplingRate = 100)

# crop the epoch
crop(epoch, start = 0.5, end = 1.5)

Run the code above in your browser using DataLab