Learn R Programming

strvalidator (version 1.5.2)

trim: Trim Data

Description

Extract data from a dataset.

Usage

trim(data, samples = NULL, columns = NULL, word = FALSE,
  ignore.case = TRUE, invert.s = FALSE, invert.c = FALSE,
  rm.na.col = TRUE, rm.empty.col = TRUE, missing = NA, debug = FALSE)

Arguments

data
data frame with genotype data.
samples
string giving sample names separated by pipe (|).
columns
string giving column names separated by pipe (|).
word
logical indicating if a word boundary should be added to samples and columns.
ignore.case
logical, TRUE ignore case in sample names.
invert.s
logical, TRUE to remove matching samples from 'data', FALSE to remove samples NOT matching (i.e. keep matching samples).
invert.c
logical, TRUE to remove matching columns from 'data', FALSE to remove columns NOT matching (i.e. keep matching columns). while TRUE will remove columns NOT given.
rm.na.col
logical, TRUE columns with only NA are removed from 'data' while FALSE will preserve the columns.
rm.empty.col
logical, TRUE columns with no values are removed from 'data' while FALSE will preserve the columns.
missing
value to replace missing values with.
debug
logical indicating printing debug information.

Value

  • data.frame with extracted result.

Details

Simplifies extraction of specific data from a larger dataset. Look for samples in column named 'Sample.Name', 'Sample.File.Name', or the first column containing the string 'Sample' in mentioned order (not case sensitive). Remove unwanted columns.