dot-removeEmptyCol: Search for (empty) columns conaining only entries defined in...

.removeEmptyColR Documentation

Search for (empty) columns conaining only entries defined in 'searchFields' and remove such columns

Description

This function aims to search for (empty) columns conaining only entries defined in 'searchFields' and remove such columns. If 'fromBackOnly' =TRUE .. only tailing empty columns will be removed (other columns with "empty" entries in middle will be kept). If ”=TRUE columns containing all NAs will be excluded as well This function will also remove columns containing (exculsively) mixtures of the various 'searchFields'.

Usage

.removeEmptyCol(
  dat,
  fromBackOnly = TRUE,
  searchFields = c("", " ", "NA.", NA),
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Arguments

dat

(matrix or data.frame) main input

fromBackOnly

(logical)

searchFields

(character)

silent

(logical) suppres messages

debug

(logical) additional messages for debugging

callFrom

(character) allows easier tracking of messages produced

Value

This function returns a corrected matrix or data.frame

See Also

renameColumns; is.finite

Examples

ma1 <- matrix(c(1:5, NA), ncol=2)
.removeEmptyCol(ma1)

wrMisc documentation built on Sept. 11, 2024, 6:10 p.m.