Plot tract profiles for each bundle as a facet and each metric as a figure.
Source:R/plot.R
plot_tract_profiles.Rd
Plot tract profiles for each bundle as a facet and each metric as a figure.
Arguments
- df
Data frame.
- metrics
Name(s) of the metrics to plot per figure, character vector. By default, will be all diffusion metrics in the provided data frame.
- bundles
Name(s) of the tract bundles to plot per facet, character vector. By default, will be all tract bundles in the provided data frame.
- bundles_col
Name of the column in the provided data frame with the tract bundles.
- group_col
Name of the column in the data frame to group by as a color, character. By default, no grouping variable is provided.
- line_func
Line function that provides the line positioning. See stat_summary for more information.
- linewidth
Line thickness of the tract profile line.
- ribbon_func
Ribbon function that provides the range for the ribbon. See stat_summary for more information.
- ribbon_alpha
Ribbon alpha level.
- n_groups
Number of groups to split a numeric grouping variable.
- pal_name
Grouping color palette name, character. Default is colorblind.
- out_dir
Output directory of saved plots.
- figsize
Figure size. A numeric vector of (width, height) in inches.
Examples
if (FALSE) { # \dontrun{
df <- read_afq_sarica()
plot_tract_profiles(
df,
metrics = c("fa"),
bundles = c("Left Corticospinal", "Right Corticospinal"),
group_col = "class",
figsize = c(8, 6)
)
plot_tract_profiles(
df,
metrics = c("fa"),
bundles = c("Left Corticospinal", "Right Corticospinal"),
group_col = "age",
n_groups = 3,
pal_name = "Spectral",
figsize = c(8, 6)
)
} # }