I want to get the columns names of a Data Frame with the following code:
DF <- data.frame(X=c(1,2), Y=c(3,4))
as.character(sapply(DF, names))
I've got the following:
"NULL" "NULL"
but I need the following result:
"X" "Y"
How can I do this, thanks in advance.
See Question&Answers more detail:os