AppendRowNames: Append Rownames to a Data Frame

View source: R/DescTools.r

AppendRowNamesR Documentation

Append Rownames to a Data Frame

Description

Append rownames to a data.frame as first column.

Usage

AppendRowNames(x, names = "rownames", after = 0, remove_rownames = TRUE)

Arguments

x

a data.frame

names

the name of the new inserted column containing the rownames.

after

a subscript, after which the values are to be appended. If missing the rownames will be inserted as first column.

remove_rownames

logical defining if the existing rownames should be removed. Default is TRUE.

Value

the object x with appended rownames

Author(s)

Andri Signorell <andri@signorell.net>

See Also

Append

Examples

(dd <- data.frame(x=1:5, y=6:10, z=LETTERS[1:5], 
                  row.names = letters[1:5]))
AppendRowNames(dd)

AndriSignorell/DescTools documentation built on Dec. 1, 2024, 5:13 a.m.