mark_qcs: Replace NA values in pheno data columns with "QC"

View source: R/transformations.R

mark_qcsR Documentation

Replace NA values in pheno data columns with "QC"

Description

Loops through specified columns in pheno data and replaces all NA values with "QC". Also transforms the column to factor and sets "QC" as the last level.

Usage

mark_qcs(data, cols)

Arguments

data

a data frame such as pheno_data returned by read_from_excel

cols

the columns to fix

Value

a data frame with the column modified

Examples

# Remove QC labels first
pheno_data <- pData(merged_sample)
pheno_data$Group[pheno_data$Group == "QC"] <- NA
head(pheno_data$Group, 20)
pheno_data <- mark_qcs(pheno_data, cols = "Group")
head(pheno_data$Group, 20)


antonvsdata/notame documentation built on Sept. 14, 2024, 11:09 p.m.