gpt4 book ai didi

r - `geom_a(stat="b", ... )` and ` stat_b(geom ="a",...)`之间有什么区别吗?

转载 作者:行者123 更新时间:2023-12-04 10:14:54 25 4
gpt4 key购买 nike

我见过这两种用法,但我不知道实际中 2 之间的区别。

而且,为什么

stat_vline(xintercept="mean", geom="vline") # this works


geom_vline(xintercept="mean", stat="vline") # this doesn't work

这是否意味着通过后 mean到下一层 vline在这种情况下,函数变成了字符?这种行为是普遍的吗?

最佳答案

您可能发现了一个错误。如果您指定美学映射(再次),它会起作用:

p <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()
p + geom_vline(aes(x=wt, y=mpg), xintercept="mean", stat="vline")

典型用于 ggplot2文档有点稀少,这使得很难判断这是否是故意的。

关于r - `geom_a(stat="b", ... )` and ` stat_b(geom ="a",...)`之间有什么区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18786161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com