setColnames | R Documentation |
This function sets new column names for a given data frame or matrix.
setColnames(object, newColnames)
object |
A data frame or matrix. |
newColnames |
A character vector specifying the new column names. |
The data frame or matrix with updated column names.
# Set new column names for a data frame
df <- data.frame(A = c(1, 2, 3), B = c(4, 5, 6))
setColnames(df, c("X", "Y"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.