dfRowName | R Documentation |
Transfer rownames of data frame to a new column (for data export)
dfRowName(x, name = "Rows", stringsAsFactors = FALSE)
x |
Data frame |
name |
Name of the new column to be created |
stringsAsFactors |
Logical; should character vectors be converted to factors? (default, FALSE) |
Data frame
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.