geom_rug_alt <- function(mapping = NULL,data = NULL,stat = "identity",position = "identity",...){GeomRugAlt$new(mapping = mapping,data = data,stat = stat,position = position,...)}GeomRugAlt <- proto(Geom, {objname <- "rug_alt"draw <- function(., data, scales, coordinates, ...) {rugs <- list()data <- coordinates$transform(data, scales)if (!is.null(data$x)) {rugs$x <- with(data, segmentsGrob(x0 = unit(x, "native"), x1 = unit(x, "native"),y0 = unit(1 - 0.03, "npc"), y1 = unit(1, "npc"),gp = gpar(col = alpha(colour, alpha), lty = linetype, lwd = size * .pt)))}if (!is.null(data$y)) {rugs$y <- with(data, segmentsGrob(y0 = unit(y, "native"), y1 = unit(y, "native"),x0 = unit(1, "npc"), x1 = unit(1 - 0.03, "npc"),gp = gpar(col = alpha(colour, alpha), lty = linetype, lwd = size * .pt)))}gTree(children = do.call("gList", rugs))}default_stat <- function(.) StatIdentitydefault_aes <- function(.) aes(colour="black", size=0.5, linetype=1, alpha = 1)guide_geom <- function(.) "path"})
In the short term, use ggplot2:::Geom. In the long term (at least a
year probably), all the proto is going away, and geoms will use S3.
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/