Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I could not find an example exactly like yours, but I can give you a few ideas that might help you on your way there:</p> <p>To group related bars, the <code>ggplot2</code> package offers two possibilities:</p> <ol> <li><p>Position two related bars next to each other, using the <code>geom_bar(position="dodge")</code> command, like here: <a href="http://www.cookbook-r.com/Graphs/Bar_and_line_graphs_(ggplot2)/#bar-graphs" rel="nofollow">http://www.cookbook-r.com/Graphs/Bar_and_line_graphs_(ggplot2)/#bar-graphs</a></p></li> <li><p>Group related bars under a common headline, using <code>facet_grid(...)</code> (in cookbook-r, you can find more info about that under Index >> Graphs >> Facets(ggplot2)).</p></li> </ol> <p>If you should decide to use <code>ggplot2</code>, you may want to try <code>example(geom_bar)</code>, which will also give you some examples as to how stacked plots can be created (e.g. using <code>position="fill"</code>, which will give you a stacked bar chart like the one above). </p> <p>Unfortunately, I don't know how to handle data as complex as yours in combination with plotting. But the <code>reshape</code> package has helped me a lot whenever I needed to transform my data, e.g. using the <code>melt()</code> function, as it is used here: <a href="http://www.cookbook-r.com/Manipulating_data/Converting_data_between_wide_and_long_format/" rel="nofollow">http://www.cookbook-r.com/Manipulating_data/Converting_data_between_wide_and_long_format/</a></p> <p>Hope I could help a little. Feel free to give me some feedback to my answer.</p> <p>Markus</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload