trimTable: Trims empty columns from tables.

trimTableR Documentation

Trims empty columns from tables.

Description

Downloaded spreadsheets sometimes contain empty columns at the end. This function removes all of the columns after the give column.

Usage

trimTable(tab, lastcol = "Description")

Arguments

tab

A matrix, data frame or tibble to be trimmed).

lastcol

The name of the last column to keep. Any column to the right of this one will be discarded.

Value

The first several columns of the table.

Author(s)

Russell Almond

See Also

read.csv

Examples


dat <- data.frame(One=1:3,Two=4:6,Three=7:9,10:12)
trimmed <- trimTable(dat,"Three")
stopifnot (ncol(trimmed)==3L)


ralmond/EABN documentation built on Aug. 30, 2023, 12:52 p.m.