I have a result of "aggregate" like this:
week year Severity
1 10 2013 26
2 11 2013 5
3 16 2013 26
I would like to draw a barplot with (as maximum) 52 bars (one for every week) with stacked bars of "severity" height for every year. I see from "barplot" documentation that I need a matrix for that. Of course I could use for/while and smth like that to get what I need, but I wonder if there's not a more "R-ish" way to solve this (seemingly pretty typical task) ?
So, in more technical terms, I need to convert my {X; 3} dimensional data frame to a {52; Y} dimensional matrix, where values of "severity" for "year" and "week" will be placed into proper "cells".
I've tried to use "melt" but the only difference I see is a change in column names + extra column.
Any ideas? Thanks !