car (version 1.0-2)

which.names: Position of Row Names

Description

This function returns the indices of row names in a data frame or a vector of names.

Usage

which.names(names, object)

Arguments

names
a name or character vector of names.
object
a data frame or character vector of (row) names.

Value

  • Returns the index or indices of names within object.

Examples

Run this code
data(Duncan)
which.names(c('minister', 'conductor'), Duncan)
## [1]  6 16

Run the code above in your browser using DataCamp Workspace