Automatically detect row names column, if defined.
Arguments
- object
Object.
- choices
character
. Column name choices to use internally for matching. Note that case-insensitive matching is performed againstmake.names()
return internally. Either dots (".") or underscores ("_") used as word separators will match.- ...
Additional arguments.
Examples
## data.table ====
if (requireNamespace("data.table", quietly = TRUE)) {
data(data.table, package = "AcidTest")
object <- data.table
matchRownameColumn(object)
}
#> [1] "rn"
## tbl_df ====
if (requireNamespace("tibble", quietly = TRUE)) {
data(tibble, package = "AcidTest")
object <- tibble
matchRownameColumn(object)
}
#> [1] "rowname"