sanitizeSampleData: Sanitize sample data

View source: R/sanitizeSampleData.R

sanitizeSampleDataR Documentation

Sanitize sample data

Description

Drop any columns defined in denylist, and ensure character columns containing any duplicate values are automatically coerced to factor.

Usage

sanitizeSampleData(object)

Arguments

object

DFrame (recommended) or data.frame (legacy). Note that legacy data.frame support will be removed in a future update.

Value

DFrame.

Denylist

Here's the current column denylist:

  • interestingGroups.

  • sampleId.

Note

Updated 2023-04-27.

Examples

data(RangedSummarizedExperiment, package = "AcidTest")
rse <- RangedSummarizedExperiment

## SummarizedExperiment ====
from <- sampleData(rse)
print(from)
to <- sanitizeSampleData(from)
all(vapply(to, is.factor, logical(1L)))
print(to)

acidgenomics/r-acidexperiment documentation built on Jan. 17, 2024, 7:56 p.m.