Skip to content

Instantly share code, notes, and snippets.

@yutannihilation
Last active September 30, 2015 14:29
Show Gist options
  • Select an option

  • Save yutannihilation/9c0786004363bdf9c579 to your computer and use it in GitHub Desktop.

Select an option

Save yutannihilation/9c0786004363bdf9c579 to your computer and use it in GitHub Desktop.
library(dplyr)
library(purrr)
library(ggplot2)
e <- asNamespace('ggplot2')
Geoms <- grep("^Geom.+", ls(e), value = TRUE)
geoms <-
Geoms %>%
map(~ get(., envir = e))
result <- geoms %>%
map(~ c(.$default_aes, geom = sub("Geom", "", class(.)[1])) %>%
map_if(is.na, ~ return("yes")) %>%
map(as.character) %>%
as.list) %>%
bind_rows
result[is.na(result)] <- '--'
cols <- colnames(result)
result <- result[,c("geom", setdiff(cols, "geom"))]
print(result, n = 100)
#> Source: local data frame [40 x 25]
#>
#> geom colour size linetype alpha fill weight shape outlier.colour outlier.shape outlier.size outlier.stroke xmin xmax ymin ymax width height angle hjust vjust family fontface lineheight stroke
#> (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr) (chr)
#> 1 Abline black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 2 AnnotationMap NA 0.5 1 yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 3 Area yes 0.5 1 yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 4 Bar yes 0.5 1 yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 5 Blank -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 6 Boxplot grey20 0.5 solid yes white 1 19 black 19 1.5 0.5 -- -- -- -- -- -- -- -- -- -- -- -- --
#> 7 Contour #3366FF 0.5 1 yes -- 1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 8 Crossbar black 0.5 1 yes yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 9 Curve black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 10 CustomAnn -- -- -- -- -- -- -- -- -- -- -- -Inf Inf -Inf Inf -- -- -- -- -- -- -- -- --
#> 11 Density black 0.5 1 yes yes 1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 12 Density2d #3366FF 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 13 Dotplot black -- -- yes black -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 14 Errorbar black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- 0.5 -- -- -- -- -- -- -- --
#> 15 Errorbarh black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- 0.5 -- -- -- -- -- -- --
#> 16 Hex yes 0.5 -- yes grey50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 17 Hline black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 18 Label black 3.88 -- yes white -- -- -- -- -- -- -- -- -- -- -- -- 0 0.5 0.5 1 1.2 --
#> 19 Line black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 20 Linerange black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 21 Logticks black 0.5 1 1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 22 Map NA 0.5 1 yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 23 Path black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 24 Point black 1.5 -- yes yes -- 19 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 0.5
#> 25 Pointrange black 0.5 1 yes yes -- 19 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1
#> 26 Polygon NA 0.5 1 yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 27 Quantile #3366FF 0.5 1 yes -- 1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 28 Raster -- -- -- yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 29 RasterAnn -- -- -- yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 30 Rect yes 0.5 1 yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 31 Ribbon yes 0.5 1 yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 32 Rug black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 33 Segment black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 34 Smooth #3366FF 1 1 0.4 grey60 1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 35 Spoke black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 36 Step black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 37 Text black 3.88 -- yes -- -- -- -- -- -- -- -- -- -- -- -- -- 0 0.5 0.5 1 1.2 --
#> 38 Tile yes 0.1 1 yes grey20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 39 Violin grey20 0.5 solid yes white 1 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
#> 40 Vline black 0.5 1 yes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment