[R] names over names

Richard M. Heiberger rmh at temple.edu
Wed Jun 20 15:09:05 CEST 2007


If your data.frame is entirely numeric, then you could design a print
function that builds on this example of converting it to a data.matrix:


mydf <- data.frame(Mon=1:3, Tue=4:6, Wed=7:9, Thu=10:12, Fri=13:15)
mydm <- data.matrix(mydf)
names(dimnames(mydm)) <- c("", "Weekdays")
mydm
data.frame(mydm) ## loses names(dimnames)



More information about the R-help mailing list