[R] Barplot

From: Muhammad Subianto <msubianto_at_gmail.com>
Date: Wed 30 Aug 2006 - 19:43:23 EST


Dear all,
I have a dataset. I want to make barplot from this data. Zero1 <- "

   V1 V2 V3 V4 V5 V6 V7 V8 V9
1 1 0 0 0 1 0 0 0 Positive
2 0 0 1 0 1 0 1 1 Negative
3 0 0 1 0 0 0 1 1 Positive
4 0 1 0 1 1 1 0 1 Negative
5 0 0 1 0 1 1 0 0 Positive
6 0 1 0 0 1 1 1 1 Negative
7 1 0 1 1 1 1 1 1 Negative
8 0 0 0 0 1 0 0 1 Negative
9 0 1 1 1 1 0 0 1 Negative
10 0 0 0 1 1 0 1 0 Positive
11 0 0 0 0 1 0 0 1 Negative
12 0 0 1 1 1 1 1 0 Positive
13 0 1 1 0 1 1 1 1 Negative"

z1 <- read.table(textConnection(Zero1), header=TRUE) z1
str(z1)

A simple way I can use mosaic plot
mosaicplot(table(z1))
library(vcd)
mosaic(table(z1))

I have tried to learn ?xtabs ?table and ?ftable but I can't figure out. I need a barplot for all variables and the result maybe like

| | | |
| | | | | | | | |
|pos|neg| |pos|neg| |pos|neg|
| | | | | | | | |

--------- ---------            ---------
    v1        v2    v3 .... v7     v8

Thanks you for any helps.
Regards, Muhammad Subianto



R-help@stat.math.ethz.ch 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 Wed Aug 30 19:46:14 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 31 Aug 2006 - 02:24:58 EST.

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