Skip to content
Prev 172863 / 398521 Next

R code -column headings

To do that be sure to give each dimension, itself, a name when
the matrix is defined:

mat <-matrix(c(266, 359, 533, 313, 555, 504, 502, 242), nrow = 4,
	dimnames = list(Region = c("Northeast", "Midwest", "South", "West"),
				Type = c("Public", "Private")))
as.data.frame(as.table(mat))
addmargins(mat)
On Fri, Mar 6, 2009 at 12:13 PM, Mary A. Marion <mam5eb at virginia.edu> wrote: