clean: clean Function

Description Usage Arguments Examples

View source: R/clean.R

Description

This function remove columns of a dataframe that provide no info (identitcal accross all rows) or disinct accross all rows. Useful to clean metadata files.

Usage

1
clean(tb, unique = TRUE, keep = NULL)

Arguments

tb

the data.frame or tibble

unique

whether to keep unique columns

keep

a vector of columns to keep

Examples

1
2
3
4
5
6
7
8
9
metaData <- data.frame(SRA = "SRA17CJQ1",
                       ID1 = sample(letters, 12, replace = FALSE),
                       group = c(rep("group1", 4),
                                 rep("group2", 4),
                                 rep("group3", 4)))
metaData$ID2 <- toupper(metaData$ID1)
metaData
clean(metaData)
clean(metaData, unique = FALSE, keep = "ID1")

HectorRDB/HectorRDB documentation built on Oct. 15, 2020, 6:16 p.m.