【发布时间】:2017-02-17 17:23:43
【问题描述】:
我正在学习有关 R 的 Udacity 课程,其中一个练习让我编写此代码以绘制散点图并覆盖一条“平均”线和三个“四分位数”线。
ggplot(aes(x = age, y = friend_count), data = pf) +
xlim(13, 90) +
geom_point(alpha = 0.05, position = position_jitter(h = 0), color = 'orange') +
coord_trans(y = 'sqrt') +
geom_line(stat = 'summary', fun.y = mean) +
geom_line(stat = 'summary', fun.y = quantile, fun.args = list(probs = 0.1), color = 'blue', linetype = 2) +
geom_line(stat = 'summary', fun.y = quantile, fun.args = list(probs = 0.5), color = 'blue', linetype = 2) +
geom_line(stat = 'summary', fun.y = quantile, fun.args = list(probs = 0.9), color = 'blue', linetype = 2)
我想在geom_line 中查看fun 参数的文档,所以我查看了geom_line 的文档(R Studio 和在线),geom_line 函数显示为
geom_line(mapping = NULL, data = NULL, stat = "identity", position = "identity",
na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)
我在任何地方都看不到fun 参数。所以我的问题是:如果我还没有了解 Udacity 课程中的 fun 参数,我如何通过查看文档来了解它以及我如何获得更多信息?
【问题讨论】: