how to change first row with header names in r code example
Example 1: convert first row to header in r
header.true <- function(df) {
names(df) <- as.character(unlist(df[1,]))
df[-1,]
}
Example 2: make the first row as header in r
names(dat) <- dat[1,]