[R] R code -column headings

Mary A. Marion mam5eb at virginia.edu
Fri Mar 6 18:13:29 CET 2009


Hello,

I have been noticing that some of my column headings are missing. 
Can you give me a clue as to how to

1] replace Var1 and Var 2 by Region and type ie do it right the first time

x<-matrix(c(266, 359, 533, 313, 555, 504, 502, 242),nrow=4)
rownames(x)=c( "Northeast", "Midwest", "South", "West" )
colnames(x)=c("Public", "Private")
as.data.frame(as.table(x))

2] add a column heading for region when I use addmargins(x)

addmargins(x)
#margin.table(x,1)
#margin.table(x,2)

Thank you.
Sincerely,
Mary A. Marion




More information about the R-help mailing list