rencol | R Documentation |
rencol
renames columns in a data frame.
rencol(d, on, nn, i = NULL,
regexp = FALSE, multi = FALSE)
d |
data frame |
on |
original column name (or a regexpr) |
nn |
desired column name (or a regexpr) |
i |
optional column index that must match the column with the name
denoted by |
regexp |
logical flag indicating whether |
multi |
logical flag indicating whether to change multiple coumns at once |
Tomas Sieger
cpcol
tmp<-data.frame(a=1:2,b=2:3)
rencol(tmp,'a','a2')
rencol(tmp,'a','a2',1)
# get rid of a common prefix
tmp<-data.frame(prefix.a=1:2,prefix.b=2:3)
rencol(tmp,'prefix.','',multi=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.