matchRownameColumn: Match row name column

matchRownameColumnR Documentation

Match row name column

Description

Automatically detect row names column, if defined.

Usage

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")
)

Arguments

object

Object.

choices

character. Column name choices to use internally for matching. Note that case-insensitive matching is performed against make.names() return internally. Either dots (".") or underscores ("_") used as word separators will match.

...

Additional arguments.

Details

The data.table package uses "rn" by default, whereas tibble uses "rowname".

Value

character(1) or NULL.

  • data.table: "rn".

  • tibble: "rowname".

Note

Updated 2021-10-14.

Examples

## 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)
}

steinbaugh/brio documentation built on Feb. 1, 2024, 6:42 p.m.