Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
@hadley
28 lines (24 sloc) 0.907 kb
#' Display a smooth density estimate.
#'
#' A smooth density estimate calculated by \code{\link{stat_density}}.
#'
#' @section Aesthetics:
#' \Sexpr[results=rd,stage=build]{ggplot2:::rd_aesthetics("geom", "density")}
#'
#' @seealso \code{\link{geom_histogram}} for the histogram and
#' \code{\link{stat_density}} for examples.
#' @inheritParams geom_point
#' @export
#' @examples
#' # See stat_density for examples
geom_density <- function (mapping = NULL, data = NULL, stat = "density", position = "identity",
na.rm = FALSE, ...) {
GeomDensity$new(mapping = mapping, data = data, stat = stat, position = position,
na.rm = na.rm, ...)
}
GeomDensity <- proto(GeomArea, {
objname <- "density"
default_stat <- function(.) StatDensity
default_pos <- function(.) PositionIdentity
default_aes <- function(.) defaults(aes(fill=NA, weight=1, colour="black", alpha = NA), GeomArea$default_aes())
})
Jump to Line
Something went wrong with that request. Please try again.