is.row.names {str2str} | R Documentation |
Test for 'row.names'
Description
is.row.names
returns whether elements of a character vector are row.names of an object.
Usage
is.row.names(nm, x)
Arguments
nm |
character vector. |
x |
object whose row.names are desired to be tested. |
Details
If the object does not have any row.names, then the function will return 'FALSE'
for each element of the character vector. As a reminder, row.names
does not
respond to a manually added "row.names" attribute (e.g., to a vector). If this is
tried, then is.row.names
will return 'FALSE' for each element 'nm'.
Value
TRUE for every element of 'nm' that is a row.name of x and FALSE otherwise. The structure is a logical vector with length = length('nm') and names = 'nm'. See details for special cases.
Examples
data("mtcars")
is.row.names(x = mtcars, nm = c("Mazda RX4","mazda RX4"))
[Package str2str version 1.0.0 Index]