Get Sample Indices from Sampling Frame
Source:R/all_generic.R, R/dataset_methods.R, R/sampling_frame_adapters.R
samples.RdGenerates a vector of timepoint indices, typically used for time series analysis or indexing operations.
Usage
samples(x, ...)
# S3 method for class 'matrix_dataset'
samples(x, ...)
# S3 method for class 'fmri_dataset'
samples(x, ...)
# S3 method for class 'fmri_mem_dataset'
samples(x, ...)
# S3 method for class 'fmri_file_dataset'
samples(x, ...)
# S3 method for class 'fmri_study_dataset'
samples(x, ...)
# S3 method for class 'sampling_frame'
samples(x, ...)See also
n_timepoints for total number of samples,
blockids for run membership
Examples
# \donttest{
# Create a sampling frame
sf <- fmrihrf::sampling_frame(blocklens = c(100, 120), TR = 2)
s <- samples(sf)
length(s) # 220
#> [1] 220
range(s) # c(1, 220)
#> [1] 1 220
# }