RemoveRowsAndOrColumns: Remove Rows and Columns From Tabular Data By Names

View source: R/removerowsandorcolumns.R

RemoveRowsAndOrColumnsR Documentation

Remove Rows and Columns From Tabular Data By Names

Description

Given tabular data and character vectors or delimited strings of row and column names, produces a table with the specified rows and columns removed. Where a list is supplied, column.names.to.remove are applied to the list.

Usage

RemoveRowsAndOrColumns(
  x,
  row.names.to.remove = c("NET", "Total", "SUM"),
  column.names.to.remove = c("NET", "Total", "SUM"),
  split = "[;,]"
)

Arguments

x

Data to remove rows and columns from; can be a matrix or data.frame or a list of matrices and data.frames.

row.names.to.remove

A vector or comma-separated string containing the row labels to remove.

column.names.to.remove

A vector or comma-separated string containing the column labels to remove.

split

Character delimiter to split row.names.to.remove and col.names.to.remove on. Default is to split on either of "," or ";". Assumed to be a regular expression; see strsplit.

Details

Trailing spaces are removed and lower/upper case is ignored.

Value

x with the rows specified in row.names.to.remove and columns specified in column.names.to.remove removed.


NumbersInternational/flipTables documentation built on May 2, 2024, 11:29 p.m.