I have many data frames that I need to use the first row of each as their column names.
So I write this line but it does not work:
colnames <- colnames(df) {
colnames(df) <- df[1,]
df <- df[-1, ]
}
Do you have any idea what's wrong with it? Thanks!