PolyGenius
Contents

align

Match a table to a study's samples by an ID column

Tags value so that study$samples$<name> <- align(value, by = ...) matches its rows to the study's samples by the IDs by gives. align() only attaches the tag; the matching runs inside the assignment. See Assigning sample-level data in PolyGeniusStudy() for the full rules.

Usage

align(value, by = NULL)

Arguments

ArgumentDescription
valueA table whose rows are matched to the samples.
byAn expression evaluated using value's columns, giving one sample ID per row, such as IID or paste(FID, IID, sep = "_"). NULL (default) matches on value's own rownames or names, and the assignment aborts when it has none.

Value

value, unchanged apart from an align attribute holding list(by = <quosure>). The assignment removes the attribute before storing the value.

Examples

pheno <- read.csv("cohort-phenotypes.csv")   # IID, age, sex, mmse, in its own row order
study$samples$phenotypes <- align(pheno, by = IID)

See Also

reduction(), the sibling tag for an embedding.

Other study: PolyGeniusFrame(), PolyGeniusFrameSet(), PolyGeniusStudy(), reduction(), roles()