Barplot in R, aggregation of sampled data

Posted by Felix on Stack Overflow See other posts from Stack Overflow or by Felix
Published on 2010-03-08T16:37:21Z Indexed on 2010/03/08 16:51 UTC
Read the original article Hit count: 227

Filed under:

Hello,

I want an stacked barplot, or at least two barplots (histogramms) of the data below. But I cant't figure out how. plot(online) is not the solution, I´m looking for. Please see below.

          online              offline
1         sehrwichtig             wichtig
2             wichtig           unwichtig
3         sehrwichtig           unwichtig
4         sehrwichtig         sehrwichtig
5         sehrwichtig         sehrwichtig
6         sehrwichtig           unwichtig
7         sehrwichtig           unwichtig
8             wichtig             wichtig
9             wichtig           unwichtig
10        sehrwichtig         sehrwichtig
11        sehrwichtig             wichtig
12        sehrwichtig           unwichtig
13            wichtig         sehrwichtig
14        sehrwichtig             wichtig

I know I need a step, where the data is aggregated to:

                   online        offline 
   sehrwichtig           6         7 
   unwichtig             0         1 
   wichtig               3         5 

But how?

© Stack Overflow or respective owner

Related posts about r