Skip to content
Prev 275610 / 398506 Next

Plot complete dataset

You should go back and read the help for barplot.  Do you really want to plot the whole dataset (say as a stacked barplot)? Then something like this should do it.

barplot(as.matrix(dataset[,2:5]),  col = c("lightblue", "mistyrose", "lightcyan",
                "lavender", "cornsilk"), 
  legend = dataset$Ages, ylim = c(0, 100))

Your values don't add to 100, so I'm not sure what you actually want.  If this isn't what you want then give us more information.


Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204