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

Description Usage Arguments Value Examples

View source: R/transformations.R

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

1
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

1
2
3
4
5
6
# 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/amp documentation built on Jan. 8, 2020, 3:15 a.m.