Learn R Programming

strvalidator (version 1.5.2)

slim: Slim Data Frames

Description

Slim data frames with repeated columns.

Usage

slim(data, fix = NULL, stack = NULL, keep.na = TRUE, debug = FALSE)

Arguments

data
data.frame.
fix
vector of strings with colum names to keep fixed.
stack
vector of strings with colum names to slim.
keep.na
logical, keep a row even if no data.
debug
logical indicating printing debug information.

Value

  • data.frame

Details

Stack repeated columns into single columns. For example, the following data frame: Sample.Name|Marker|Allele.1|Allele.2|Size.1|Size.2|Data.Point.. using this command: slim(data, fix=c("Sample.Name","Marker"), stack=c("Allele","Size")) would result in this data frame (NB! 'Data.Point' is dropped): Sample.Name|Marker|Allele|Size