RemoveAt: 'RemoveAt'

View source: R/removeat.R

RemoveAtR Documentation

RemoveAt

Description

Removes one or more elements from an object. Dimensions are never If all elements are removed from a vector, then a 0-length vector is returned.

Usage

RemoveAt(x, at = NULL, MARGIN = NULL, ignore.case = TRUE, split = NULL)

## S3 method for class 'data.frame'
RemoveAt(x, at = NULL, MARGIN = NULL, ignore.case = TRUE, split = NULL)

## S3 method for class 'array'
RemoveAt(x, at = NULL, MARGIN = NULL, ignore.case = TRUE, split = NULL)

## S3 method for class 'matrix'
RemoveAt(x, at = NULL, MARGIN = NULL, ignore.case = TRUE, split = NULL)

## S3 method for class 'ftable'
RemoveAt(x, at = NULL, MARGIN = NULL, ignore.case = TRUE, split = NULL)

Arguments

x

The object from which the elements are to be removed.

at

A vector or indicating which elements are to be removed. When at is character elements with this name are removed. When at is integer, elements with this position are removed. If MARGIN contains two or more values, at may be a list, where each element of the list contains a vector.

MARGIN

An vector of integers giving the dimensions from which elements should be removed.

ignore.case

Ignores case if and when removing elements based on their names.

split

Character delimiter to split at when at is a character. Default is NULL which means that no splitting occurs. See strsplit.

Value

An object of the same class as x.

Methods (by class)

  • RemoveAt(data.frame): Where only a at is provided, it is assumed to be the variables of a data frame. Otherwise, the first MARGIN is assumed the rows and the second the columns.

  • RemoveAt(array): If MARGIN is not provided, the at argument is used along all margins. If at is a list, then each list element is sequentially used along each MARGIN If at is not a list, then it all elements inside is are removed across all margins.

  • RemoveAt(matrix): Applies the array method

  • RemoveAt(ftable): If any characters are used in at but the ftable doesn't have dimnames then the original ftable is returned. If integer references are used, then the appropriate dim is removed using the array method. If the ftable has dimnames and characters are used at then array method is used so that the dimnames of ftable are used to determine the rows or columns in the removal. In all cases, the row.var and col.var attributes are not retained in the output.


NumbersInternational/flipU documentation built on March 2, 2024, 10:55 a.m.