Skip to content
Prev 168989 / 398506 Next

Broke ggplot...

On Mon, Feb 2, 2009 at 5:41 PM, Jason Rupert <jasonkrupert at yahoo.com> wrote:
...

You can do this a bit more easily with:

VADeaths_flat_df <- melt(VADeaths)
names(VADeaths_flat_df) <- c("Age", "Person", "Data")
Those plots look fine to me (well they're what I'd expect from the
definition), but I'd think you'd want

ggplot(VADeaths_flat_df, aes(Data, fill = Person)) +
  geom_histogram(binwidth=20)

or maybe

ggplot(VADeaths_flat_df, aes(Person, weight = Data)) + geom_bar()
ggplot(VADeaths_flat_df, aes(Person, weight = Data, fill = Age)) + geom_bar()

Hadley