replace column header in r with first row 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,]