Get Number of Timepoints from Sampling Frame
Source:R/all_generic.R, R/dataset_methods.R, R/sampling_frame_adapters.R
n_timepoints.RdExtracts the total number of timepoints (volumes) across all runs from objects containing temporal structure information.
Usage
n_timepoints(x, ...)
# S3 method for class 'matrix_dataset'
n_timepoints(x, ...)
# S3 method for class 'fmri_dataset'
n_timepoints(x, ...)
# S3 method for class 'fmri_mem_dataset'
n_timepoints(x, ...)
# S3 method for class 'fmri_file_dataset'
n_timepoints(x, ...)
# S3 method for class 'fmri_study_dataset'
n_timepoints(x, ...)
# S3 method for class 'sampling_frame'
n_timepoints(x, ...)See also
n_runs for number of runs,
get_run_lengths for individual run lengths
Examples
# \donttest{
# Create a sampling frame with 3 runs
sf <- fmrihrf::sampling_frame(blocklens = c(100, 120, 110), TR = 2)
n_timepoints(sf) # Returns: 330 (sum of run lengths)
#> [1] 330
# }