Skip to contents

This function shuffles participants' demographic information (i.e., age, group, sex), thereby destroying correlations between participants' tract profiles and phenotypic data.

Usage

shuffle_df(
  df,
  target,
  shuffle_cols = NULL,
  node_col = "nodeID",
  node_group = NULL,
  tract_col = "tractID",
  participant_col = "subjectID",
  sample_uniform = FALSE
)

Arguments

df

The input dataframe.

target

The column name that encodes the metric to model.

shuffle_cols

Column names that should be shuffled.

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.

tract_col

The column name that encodes tract names. Default: "tractID"

participant_col

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

sample_uniform

Boolean flag. If TRUE, shuffling should sample uniformly from the unique values in the columns. If FALSE, shuffling will shuffle without replacement.

Value

A shuffled AFQ dataframe

Examples

if (FALSE) { # \dontrun{
df_afq <- read_csv("/path/to/afq/output.csv")
df_shuffled <- shuffle_df(df_afq, target = "dti_fa")} # }