collapse_df_reps: collapse_df_reps

View source: R/collapse_df_reps.R

collapse_df_repsR Documentation

collapse_df_reps

Description

collapse columns in df which share an identity index provided in the vector pid

Usage

collapse_df_reps(
  df,
  pid,
  method = c("min", "mean", "clean", "cor"),
  clean_thresh = 2.5,
  ignore_cols = NULL,
  show_progress = TRUE
)

Arguments

df

data frame or tibble with observations as columns

pid

patient id, character vector with length equal to number of columns in df. replicate columns are indicated by same value in corresponding elements of pid

method

what kind of collapsing to do. min = take minimum value. mean = take mean of values. clean = take mean, but if either value is below clean_thresh, set final valut o zero. cor: compute correlation across all features for data. required duplicates.

clean_thresh

for method="clean". threshold value below which if any replicate exhibits this value, set output to 0

ignore_cols

columns in df to exclude from colapse (e.g. feature id)

show_progress

logical indicating whether or not to show progress bar


brandonsie/bms documentation built on Nov. 17, 2023, 11:38 a.m.