Visualize principal component scores and loadings returned by
read_confounds(..., npcs = ...). When multiple runs are present,
the default view facets per run for scores (up to max_panels) and
aggregates loadings across runs.
Arguments
- x
A
bids_confoundsobject returned byread_confounds().- view
Character. One of
"auto","run", or"aggregate".- pcs
Integer or character vector of PCs to plot (e.g.,
1:5orc("PC1", "PC2")).- top_n
Integer. Keep the top
top_nvariables per PC based on absolute loading. Set toNULLto keep all variables.- max_panels
Integer. In
view = "auto", facet score plots only when the number of runs is at mostmax_panels.- ...
Unused.
Examples
# \donttest{
tryCatch({
ds_path <- get_example_bids_dataset("ds000001-fmriprep")
proj <- bids_project(ds_path, fmriprep = TRUE)
conf <- read_confounds(proj, npcs = 5)
plot(conf)
unlink(ds_path, recursive=TRUE)
}, error = function(e) {
message("Example requires derivatives dataset with confounds: ", e$message)
})
#> Example requires derivatives dataset with confounds: participants.tsv is missing
# }