names {base} | R Documentation |
Functions to get or set the names of an object.
names(object,
namelist = NULL);
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.)
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"