matchRownameColumn | R Documentation |
Automatically detect row names column, if defined.
matchRownameColumn(object, ...)
## S4 method for signature 'DFrame'
matchRownameColumn(
object,
choices = c("rn", "row.name", "row.names", "rowname", "rownames")
)
## S4 method for signature 'data.frame'
matchRownameColumn(
object,
choices = c("rn", "row.name", "row.names", "rowname", "rownames")
)
object |
Object. |
choices |
|
... |
Additional arguments. |
The data.table package uses "rn" by default, whereas tibble uses "rowname".
character(1)
or NULL
.
data.table: "rn"
.
tibble: "rowname"
.
Updated 2021-10-14.
## data.table ====
if (requireNamespace("data.table", quietly = TRUE)) {
data(data.table, package = "AcidTest")
object <- data.table
matchRownameColumn(object)
}
## tbl_df ====
if (requireNamespace("tibble", quietly = TRUE)) {
data(tibble, package = "AcidTest")
object <- tibble
matchRownameColumn(object)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.