d <- data.frame(E = c("D","at","a"),w = c(11,22,33))
x <- c(2,5,1)
ch <- c("I","have","fun")
F <- factor(c("A","B","C"))
cbind.colnames(c("F","ch","x","F"),d)
# E w F ch x F
# 1 D 11 A I 2 A
# 2 at 22 B have 5 B
# 3 a 33 C fun 1 C
cbind.colnames(c("x","F","ch","x"))
data.frame(x,F,ch,x) # the same
cbind.colnames(NULL) # NULL
Run the code above in your browser using DataLab