I have input data with very many observations per day.
I can make the barplot
I want with 1 day by using table()
.
If I try to load more than 1 day and call table()
I run out of memory.
I'm trying to table() each day and concatenate the tables into totals I can then barplot
later. But I just cannot work out how to take the already table
d data and barplot each day as a stacked column.
After looping and consolidating I end up with something like this: 2 days of observations. (the Freq
column is the default from the previous table()
calls)
What is the best way to do a stacked barplot when my data ends up like this?
> data.frame(CLIENT=c("Mr Fluffy","Peppa Pig","Mr Fluffy","Dr Who"), Freq=c(18414000,9000000,7000000,15000000), DAY=c("2011-11-03","2011-11-03","2011-11-04","2011-11-04"))
CLIENT Freq DAY
1 Mr Fluffy 18414000 2011-11-03
2 Peppa Pig 9000000 2011-11-03
3 Mr Fluffy 7000000 2011-11-04
4 Dr Who 15000000 2011-11-04
>
> # What should I put here?