I want to name dataframe's columns using a vector of character. I don't know why with the following code I get the error:
Error in names(x) <- value : 'names' attribute [5] must be the same length as the vector [1]
vec <- 1:5
vec <- as.data.frame(vec)
colnames(vec) <- c("a", "b", "c", "d", "e")
Thanks in advance