plus: Rename Plus Group Column

Description Usage Arguments Value Note See Also Examples

View source: R/plus.R

Description

Rename the last column in a data frame, by appending a "+" character. This is useful if the last column is a plus group.

Usage

1
plus(x)

Arguments

x

a data frame.

Value

A data frame similar to x, after renaming the last column.

Note

If the last column name already ends with a "+", the original data frame is returned without modifications.

See Also

names is the underlying function to rename columns.

TAF-package gives an overview of the package.

Examples

1
2
3
4
5
6
7
catage <- catage.taf

# Rename last column
catage <- plus(catage)

# Shorter and less error-prone than
names(catage)[names(catage)=="4"] <- "4+"

TAF documentation built on April 7, 2021, 5:06 p.m.