names {base} R Documentation

The Names of an Object

Description


Functions to get or set the names of an object.

Usage

names(object,
    namelist = NULL);

Arguments

[object]

an R object.

namelist

a character vector of up to the same length as x, or NULL. [as Array]

envir

[as Environment]

Details

Authors

SMRUCC genomics Institute

Value

For names, NULL or a character vector of the same length as x. (NULL is given if the object has no names, including for objects of types which cannot have names.) For an environment, the length is the number of objects in the environment but the order of the names is arbitrary. For names<-, the updated object. (Note that the value of names(x) <- value Is that of the assignment, value, Not the return value from the left-hand side.)

clr value class

Examples

 x = list(1,2,3,4,5,6)
 print(names(x));
 # NULL
 names(x) = ["a", "b", "c", "d", "e", "f"];
 print(names(x));
 # [1] "a" "b" "c" "d" "e" "f"

[Package base version 2.33.856.6961 Index]