本文介绍了如何找到不同的几何和美学列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在R的 ggplot2 包中找到美学和geoms的列表,以及 help(qplot )不会产生任何结果。我无法找到一种方法来援引只有美学或geoms的帮助。



在R中调用美学帮助的正确方法是什么?

解决方案

我能想到的最佳方法是查看 help(aes)

  help(aes_colour_fill_alpha)
help(aes_group_order)
help(aes_linetype_size_shape)
help aes_position)

总结各种 aes 子如果你正在寻找一个特定的 aes theic(例如<$),你会得到其中的一个。

c $ c> help(alpha)或 help(group)



请查看 G 下的帮助索引,也许在完成 layer 的文档时或者开始)它会激发一个类似的上市/子分组。



您也可以提取ggplot2名称空间中的相关导出对象e使用

  ls(pattern ='^ geom_',env = as.environment('package:ggplot2'))

## [1]geom_ablinegeom_areageom_bargeom_bin2dgeom_blankgeom_boxplotgeom_contour
## [8]geom_crossbargeom_densitygeom_density2d geom_dotplotgeom_errorbargeom_errorbarhgeom_freqpoly
## [15]geom_hexgeom_histogramgeom_hlinegeom_jittergeom_linegeom_linerangegeom_map
## [22 ]geom_pathgeom_pointgeom_pointrangegeom_polygongeom_quantilegeom_rastergeom_rect
## [29]geom_ribbongeom_ruggeom_segmentgeom_smoothgeom_stepgeom_text geom_tile
## [36]geom_violingeom_vline

ggplot2 有一个未导出的字符向量 .all_aesthetics ,它包含所有的pos sible aesthetics

  ggplot2 :::。all_aesthetics 


I am trying to find the list of aesthetics and geoms in the ggplot2 package for R and the problem that help(qplot) does not yield any results. I can not find a way to invoke help for only aesthetics or geoms.

What is the correct way to invoke help for aesthetics in R?

解决方案

The best approach I can think of is to look at help(aes) which gives links to

help(aes_colour_fill_alpha)
help(aes_group_order)
help(aes_linetype_size_shape)
help(aes_position)

Which summarize the various aes sub groups.

You would get to one of these if you were search for a particular aestheic (eg help(alpha) or help(group)

For a list of geoms, look at the index for the help, under G. Perhaps when the documentation for layer is completed (or started) it will spur a similar listing / sub grouping.

You could also extract the relevant exported objects within the ggplot2 namespace using

ls(pattern = '^geom_', env = as.environment('package:ggplot2'))

 ## [1] "geom_abline"     "geom_area"       "geom_bar"        "geom_bin2d"      "geom_blank"      "geom_boxplot"    "geom_contour"   
 ## [8] "geom_crossbar"   "geom_density"    "geom_density2d"  "geom_dotplot"    "geom_errorbar"   "geom_errorbarh"  "geom_freqpoly"  
## [15] "geom_hex"        "geom_histogram"  "geom_hline"      "geom_jitter"     "geom_line"       "geom_linerange"  "geom_map"       
## [22] "geom_path"       "geom_point"      "geom_pointrange" "geom_polygon"    "geom_quantile"   "geom_raster"     "geom_rect"      
## [29] "geom_ribbon"     "geom_rug"        "geom_segment"    "geom_smooth"     "geom_step"       "geom_text"       "geom_tile"      
## [36] "geom_violin"     "geom_vline"   

ggplot2 has an unexported character vector .all_aesthetics which contains all the possible aesthetics

ggplot2:::.all_aesthetics

这篇关于如何找到不同的几何和美学列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 18:52