[R] Help Creating a Stacked Bar Chart with Color Coding

Wu Gong wg2f at mtmail.mtsu.edu
Thu Jul 29 15:37:46 CEST 2010

It is a little complicate for me to transform the table. Hope it works for

x <- read.table(textConnection("Johnson     4    
Smith        4
Smith        2
Smith        3
Garcia       1
Garcia       4
Rodriguez   2
Adams       2
Adams       3
Adams       4
Turner       4
Turner       3 "),header=F)
## sort data
## add another column to be the index used for reshape

y <- t(reshape(x, timevar="times", idvar="V1", direction="wide"))


A R learner.
View this message in context: http://r.789695.n4.nabble.com/Help-Creating-a-Stacked-Bar-Chart-with-Color-Coding-tp2305487p2306464.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list