关于ggplot中的内部变量的文档,面板 [英] Documentation on internal variables in ggplot, esp. PANEL

查看:119
本文介绍了关于ggplot中的内部变量的文档,面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题的答案使用了一个 PANEL 变量在 ggplot 内部。但是搜索 ggplot文档以及 Hadley Wickham的书,我根本找不到它的参考。这是记录在任何地方吗?



另外,查看 stat_bin(...)的代码,显然创建了一个矢量 count (其中包含每个唯一x的y的计数)。这也可以在 aes(...)中找到,但是我再次找不到任何文档。

所以我的问题是:是否有一个地方可以记录所有这些内部变量,或者只需要一个代码?

解决方案

在ggplot2的帮助页面中有一些令人惊讶的差距(我也会指出帮助页面中的许多其他页面将用户称为特别严重的差距)。这些变量已经存在多年,像你一样,我无法在在线帮助或包裹新闻中找到很多。 SO的搜索功能并没有多大帮助,因为它可以去掉前导和尾随的点,并用count显示所有内容。只有使用它们的例子可以在cran.r-project.org/web/packages/ggplot2/ggplot2.pdf中找到。谷歌更有帮助,搜索字符串:ggplot2 ..counts ..提供了许多信息性点击。从上下文来看,一种形式意味着这些并不是特别的变量,而是它们组合的功能和程序控制。这些参数隐含地转换了命名的参数。它们似乎在?stat_bin {ggplot2} 中隐含提及,尽管没有点,并且看起来这四个stat变量函数是同时计算的。



当我在pdf中进行搜索时,您链接到我在第57-58页的统计数据和美学表格(#4.3,4.4)被要求,但令我惊讶的是它不包括 count 。这些表格在第4.7节中描述了统计数据。



(我注意到这些投诉指向的一些页面有所改进或最近几年。 )

The answer to this question uses a PANEL variable which seems to be internal to ggplot. But searching the ggplot documentation and also Hadley Wickham's book, I can find no reference to it at all. Is this documented anywhere?

Also, looking at the code for stat_bin(...), there is evidently a vector count created (which contains the count of y for each unique x??). This is also accessible in aes(...) but, again, I can find no documentation.

So my question is: is there a place where all of these internal variables are documented, or must one just go to the code?

解决方案

There are some surprising gaps in the help pages for ggplot2 (and I would point also to the help page for ?layer to which many other pages refer users as a particularly egregious gap.) These "variables" have been around for years and like you I cannot find much in the online help or the package NEWS. SO's search facility is not much help because it strips off the leading and trailing dots and shows everything with "count". Only examples of their use can be found in cran.r-project.org/web/packages/ggplot2/ggplot2.pdf. Google is somewhat more helpful and the search string of: ggplot2 ..counts.. delivers many informative hits. From context one forms that sense that these are not so much special variables as much as they are combined functions and program controls. These arguments implicitly transform the named arguments. They do seem to be implicitly mentioned in ?stat_bin {ggplot2} albeit without the dots, and it appears that all four of these stat-variable-functions are calculated at the same time.

When I did a search in the pdf you linked to I found on pages 57-58 tables (#4.3,4.4) of "statistics" and "aesthetics" that you were asking for, but to my surprise it did not include count. Those tables are in section 4.7 that describes "stats".

(I have noticed improvement or the last couple of years in some of the pages to which these complaints were directed.)

这篇关于关于ggplot中的内部变量的文档,面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆