Learn R Programming

phylotools (version 0.1.2)

rm.col: Delete specified columns for dataframe or matrix

Description

Delete specified columns for dataframe or matrix.

Usage

rm.col(mat, to.rm = NULL)

Arguments

mat
a dataframe or matrix, must have column names.
to.rm
a character vector representing the column names that to be removed.

Value

A dataframe or matrix (according to the input data)with certain column deleted.

References

None

Examples

Run this code

x <- rnorm(600)
dim(x) <- c(20,30)
colnames(x) <- paste("col",1:30,sep = "")
rm.col(x, to.rm = c("col1", "col3", "col8", "col22", "col30"))

Run the code above in your browser using DataLab