View source: R/doby_utilities.R
renameCol | R Documentation |
Rename columns in a matrix or a dataframe.
renameCol(indata, src, tgt)
indata |
A dataframe or a matrix |
src |
Source: Vector of names of columns in |
tgt |
Target: Vector with corresponding new names in the output. |
A dataframe if indata
is a dataframe; a matrix in
indata
is a matrix.
Søren Højsgaard, sorenh@math.aau.dk
renameCol(CO2, 1:2, c("kk", "ll"))
renameCol(CO2, c("Plant", "Type"), c("kk", "ll"))
# These fail - as they should:
# renameCol(CO2, c("Plant", "Type", "conc"), c("kk", "ll"))
# renameCol(CO2, c("Plant", "Type", "Plant"), c("kk", "ll"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.