开发者

ggplot2: Viewing data generated for a plot

开发者 https://www.devze.com 2023-01-18 22:13 出处:网络
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.

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'开发者_Go百科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.


c$data

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

0

精彩评论

暂无评论...
验证码 换一张
取 消