如何找到所有包含图形功能的R包?
我总是很难找到所有可用的替代方法来生成特定的图表,无论是我已经决定使用的方法(寻找不同的变体)还是我尚未想到的方法。
R 图形手册网站提供了完整的列表R 图形函数的示例,但是对我来说,提供包名称进行搜索更容易(例如,当我想查找条形图时,我怎样才能获得包含 superbarplot
函数的结果集?。让即使我尝试搜索它的包,superbarplot 图表也不会出现在结果中: UsingR
)
R-SAS-SPSS 附加模块比较 - 特别是所提供表格中的主题图形,静态
- 给了我这个想法如果有一个地方可以按主题列出所有相关的包,那就太好了。
你对类似的事情有什么想法吗?
I always have difficulty in finding all available alternative ways to produce a specific graph, either one that I have already decided to use (looking for different variations) or one that I have not yet thought of.
The R Graphical Manual site provides a complete list of samples of R's graphics functions, however it's easier for me to search providing a package name (how else -for example- can I get a resultset including superbarplot
function, when I want to look for barplots?. Let alone that the superbarplot graph does not appear in the results even if I try searching for it's package: UsingR
)
The R-SAS-SPSS Add-on Module Comparison - and especially on topic Graphics, Static
in the table provided - gave me the idea that it would be nice to have a place where all relevant packages are listed by topic.
Do you have any idea about something like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您有兴趣了解您可以制作的所有可能的图形,您应该了解图形的语法以及(我的)在 R 中的实现:
ggplot2
。If you're interested in learning about all the possible graphics you can make, you should learn about the grammar of graphics, and (my) implementation of it in R:
ggplot2
.您的问题,或者无论如何的一般模式,显然是 sos 包 设计的主要用例。
sos 实际上比你的问题更进一步,通过包识别特定的功能;此外,它还按相关性对结果进行排名(默认情况下,您可以通过“sortby”参数更改默认行为,例如,sortby=“Date”)。
它的工作原理如下:
此包的大部分功能都是通过“< findFn”命令
例如,如果您想要
,与散点图相关的所有函数和父包的列表:这会返回一个格式化为 HTML 的数据框表并在默认浏览器中传递(如果您不希望它立即弹出,则只需将函数调用绑定到变量,然后在准备好时调用该变量)
数据框/的最右列HTML 页面是“描述和链接”。单击该列中的条目将在浏览器中打开另一个选项卡(根据浏览器中设置的用户设置首选项),其中包含该功能的完整 R 帮助页面。
例如,上面函数调用的结果显示,以“散点图”格式绘制数据的函数可以在以下包中找到:
Chart.Scatter)
另一个例子:
识别这些(以及其他)用于绘制箱线图的包/函数:
multcompBoxplot)
Your question, or the general pattern anyway, was clearly a primary use case for the design of the sos package.
sos actually goes one step further that your question requires by identifying particular functions with packages; in addition, it ranks the results by relevance (by default, you can change the default behavior via the "sortby" parameter, e.g., sortby="Date")
Here's how it works:
most of this package's functionality is exposed via the "findFn" command
for instance, if you want a list of all functions and the parent package related to scatter plots:
This returns a dataframe formatted as HTML table and delivered in your default browser (if you don't want it to pop-up immediately, then just bind the function call to a variable and then call the variable when you're ready)
The right-most column of the dataframe/HTML page is "Description and Link". Clicking an entry in that column opens another tab in your browser (according to the user-set preferences set in your browser) with the complete R help page for that function.
The results from the function call above show, for instance, that the functions for plotting data in a 'scatter plot' format are found in the following packages:
chart.Scatter)
Another example:
identifies these (among others) packages/functions for plotting boxplots:
multcompBoxplot)
您看过R Graph Gallery吗?
除此之外,您可能必须索引 CRAN 包的所有源代码才能有效搜索......
Have you seen the R Graph Gallery ?
Other than that, you may have to index all the source code of CRAN packages to search efficiently...
这些都是很好的记忆慢跑者。我赞同 ggplot2 的建议,也建议查看 CRAN 视图:
http://cran.r- project.org/web/views/
http://cran.fhcrc。 org/web/views/Graphics.html
(这个镜像在美国西海岸似乎更快)
http://dataspora.com/archive/2009/seminar/Survey_of_R_Graphics_by_Driscoll_Dataspora_Jun2009.pdf
http://zoonek2.free.fr/UNIX/48_R/04.html
(可能是世界上最长的网页)
http://www.stat.auckland.ac.nz/~ihaka/120/lectures.html
Ihaka 的讲义
these are good memory-joggers. I second the ggplot2 recommend, also recommend looking thru CRAN views:
http://cran.r-project.org/web/views/
http://cran.fhcrc.org/web/views/Graphics.html
(this mirror seems faster in west coast US)
http://dataspora.com/archive/2009/seminar/Survey_of_R_Graphics_by_Driscoll_Dataspora_Jun2009.pdf
http://zoonek2.free.fr/UNIX/48_R/04.html
(possibly world's longest webpage)
http://www.stat.auckland.ac.nz/~ihaka/120/lectures.html
Ihaka's lectures notes