This function sets new column names for a given data frame or matrix.
Examples
# 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"))
#> X Y
#> 1 1 4
#> 2 2 5
#> 3 3 6
This function sets new column names for a given data frame or matrix.
# 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"))
#> X Y
#> 1 1 4
#> 2 2 5
#> 3 3 6