Skip to contents

This function bootstrap samples an AFQ dataframe by participant. That is, it first pivots to wide format with one row per participant, bootstrap samples, and finally pivots back to long format.

Usage

bootstrap_df(
  df,
  target,
  node_col = "nodeID",
  node_group = "group",
  participant_col = "subjectID"
)

Arguments

df

The input dataframe.

target

The column name that encodes the metric to model.

node_col

The column name that encodes tract node positions. Default: "nodeID"

node_group

The column name to group the tract node smooth by. Default: NULL.

participant_col

The column name that encodes participant ID. Default: "subjectID".

Value

A shuffled AFQ dataframe

Examples

if (FALSE) { # \dontrun{
df_afq <- read.csv("/path/to/afq/output.csv")
df_bootstrap <- bootstrap_df(df_afq, "dti_fa")} # }