dfRowName: Transfer rownames of data frame to a new column (for data...

View source: R/dfRowName.R

dfRowNameR Documentation

Transfer rownames of data frame to a new column (for data export)

Description

Transfer rownames of data frame to a new column (for data export)

Usage

dfRowName(x, name = "Rows", stringsAsFactors = FALSE)

Arguments

x

Data frame

name

Name of the new column to be created

stringsAsFactors

Logical; should character vectors be converted to factors? (default, FALSE)

Value

Data frame

Examples

x <- as.data.frame(matrix(sample(1:100, 100), nrow = 10, dimnames = list(paste("row", 1:10, sep=""), paste("col", 1:10, sep=""))))
x
dfRowName(x, name = "ColumnWithRowNames")

vmikk/metagMisc documentation built on Feb. 14, 2024, 2:29 a.m.