tags:

views:

41

answers:

1

Frequently, I use functions to shape or numerically alter data that I'm passing to ggplot, so that I don't have to alter my data before putting it in.

If I've saved a plot to a variable. Is there a way to see the actual data that I'm plotting? It's a sanity check.

For example:

c <- ggplot(mtcars, aes(factor(cyl))) + geom_bar()

If I type str(c), I'm presented with $data at the top, but I would like to see it in tabular form.

+1  A: 
c$data

Now I have to pad this out so stackoverflow doesn't reject it for being too small an answer.

Spacedman
So simple. Thanks!
Brandon Bertelsen
I had exactly the same shortness problem this morning (well, yesterday's morning). Maybe this policy should be re-evaluated? :)
Roman Luštrik