[R] coerce data.frame with table-like data to a table for use with barchart.table

From: Dr Carbon <drcarbon_at_gmail.com>
Date: Mon, 17 Nov 2008 12:40:39 -0800

I have a data.frame containing survey data that is already organized like a table:

> foo

           Excellent Very Good Good Fair Poor Very Poor
Question 1         8         7    3    0    0         0
Question 2         5         5    7    1    0         0
Question 3         7        10    1    0    0         0

> class(foo)

[1] "data.frame"

I would like to make a barchart (or stripplot) with three barcharts, one for each row in the data.frame foo. It seems like I have to coerce foo to class table to use with barchart.table in lattice but a simple as.table yields no fruit. Any help appreciated.

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 17 Nov 2008 - 20:43:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 17 Nov 2008 - 21:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive