Description Usage Arguments Details Value Author(s) References See Also Examples
Change selected element names.
1 | colname(x) <- value
|
x |
an object with named elements |
value |
named character vector |
Changing column names is a common task. One can change them all at once, e.g.
colnames(x) <- c(...)
names(x) <- c(...)
or one at a time, e.g.
names(x)[names(x)==old] <- new
reshape supplies rename
, a function that changes a subset of
identified names, returning the object itself.
library(reshape)
x <- rename(x, c(label=value,...))
In contrast, name
and its data frame equivalent colname
change a
subset of identified names using assignment syntax.
name(x) <- c(label=value,...)
used for side effects
Tim Bergsma
http://metrumrg.googlecode.com
names
colnames
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.