negate {futile}R Documentation

Selectively negate columns in tabular data

Description

Negate is a convenience method to selectively negate columns of logical values in tabular data.

Usage

negate(x, slots)

Arguments

x Any tabular or 2-dimensional data set
slots A vector or list of column indices

Details

When working with logical data sets, sometimes it is necessary to negate certain sets of data. If this data appears in a tabular form, where each column is its own set, there are times when multiple columns in the table need to be negated. This function provides a convenient way to selectively negate those columns.

Value

The data with the given columns of data negated.

Author(s)

Brian Lee Yung Rowe

Examples

  m <- matrix(c(TRUE, FALSE, TRUE, TRUE, TRUE, FALSE), ncol=3)
  negate(m, slots=c(2,3))

[Package futile version 1.1.1 Index]