append: Convert Row Names to an Explicit Column

appendR Documentation

Convert Row Names to an Explicit Column

Description

Convert Row Names to an Explicit Column

Usage

append_rownames(x, ...)

## S4 method for signature 'data.frame'
append_rownames(x, after = 0, remove = TRUE, var = "rownames")

Arguments

x

A data.frame.

...

Currently not used.

after

A length-one numeric vector specifying a subscript, after which the row names are to be appended.

remove

A logical scalar: should the row names be removed?

var

A character string giving the name of column to use for row names.

Value

A data.frame.

Author(s)

N. Frerebeau

See Also

Other transformation tools: assign()

Examples

X <- data.frame(
  x = 1:5,
  y = 6:10,
  z = LETTERS[1:5]
)

## Assign column to row names
(Y <- assign_rownames(X, 3))

## Append row names to data.frame
(Z <- append_rownames(Y))

arkhe documentation built on Nov. 17, 2023, 5:09 p.m.