Row Names Attribute

DESCRIPTION:

Returns or changes the row.names attribute of a data frame.

USAGE:

row.names(x)
row.names(x) <- value

REQUIRED ARGUMENTS:

x
any object, but usually a data frame.

OPTIONAL ARGUMENTS:

value
a vector with the same length as the number of rows in x. This is coerced to a vector of character strings if it was not one already.

VALUE:

a vector of the row names of the data frame, which is usually a vector of character strings.

SIDE EFFECTS:

in the assignment form the row names of x are changed to value. The object x is also coerced to be a data frame if it is not one already.

DETAILS:

The value may be a character vector, or anything that can be coerced to a character vector. However, it should not be a bdCharacter or other bdVector; you can convert these to an ordinary vector using bd.coerce

Instead of using names to replace row names from a matrix, use rowIds or dimnames.

NOTE:

When creating a data frame using data.frame, it is possible to supply row.names which are not character, and are not coerced to character.

SEE ALSO:

.

EXAMPLES:

ff <- fuel.frame
row.names(fuel.frame)
row.names(ff) <- 1:60  # row names are now numbers, not car names