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