matchRowNameColumn: Match row name column

Description Usage Arguments Details Value Note Examples

Description

Automatically detect row names column, if defined.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
matchRowNameColumn(object, ...)

## S4 method for signature 'data.frame'
matchRowNameColumn(
  object,
  choices = c("rn", "row.name", "row.names", "rowname", "rownames")
)

## S4 method for signature 'DataFrame'
matchRowNameColumn(
  object,
  choices = c("rn", "row.name", "row.names", "rowname", "rownames")
)

Arguments

object

Object.

...

Additional arguments.

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.

Details

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

Value

character(1) or NULL.

Note

Updated 2019-10-22.

Examples

1
2
3
4
5
6
7
data(data.table, tbl_df, package = "acidtest")

## data.table ====
matchRowNameColumn(data.table)

## tbl_df ====
matchRowNameColumn(tbl_df)

steinbaugh/transformer documentation built on Jan. 9, 2020, 12:53 p.m.