diff --git a/DESCRIPTION b/DESCRIPTION index e25a6a9..73e460f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -10,12 +10,14 @@ Depends: ggplot2 (>= 2.0.0) License: AGPL + file LICENSE LazyData: true +URL: http://github.com/hrbrmstr/ggalt +BugReports: https://github.com/hrbrmstr/ggalt/issues Suggests: testthat, gridExtra, knitr, rmarkdown, - ggthemes + ggthemes, Encoding: UTF-8 Imports: graphics, diff --git a/R/coord_proj.r b/R/coord_proj.r index 9758343..40f18aa 100644 --- a/R/coord_proj.r +++ b/R/coord_proj.r @@ -6,6 +6,12 @@ #' \code{coord_proj} does, using the \code{proj4::project()} function from #' the \code{proj4} package. #' +#' \if{html}{ +#' A sample of the output from \code{coord_proj()} using the Winkel-Tripel projection: +#' +#' \figure{coord_proj_01.png}{options: width="100\%" alt="Figure: coord_proj_01.png"} +#' } +#' #' @param proj projection definition. If left \code{NULL} will default to #' a Robinson projection #' @param inverse if \code{TRUE} inverse projection is performed (from a diff --git a/R/geom_ash.r b/R/geom_ash.r index 3819353..b4c62bc 100644 --- a/R/geom_ash.r +++ b/R/geom_ash.r @@ -2,6 +2,12 @@ #' #' See \code{\link[ash]{bin1}} & \code{\link[ash]{ash1}} for more information. #' +#' \if{html}{ +#' A sample of the output from \code{stat_ash()}: +#' +#' \figure{stat_ash_01.png}{options: width="100\%" alt="Figure: stat_ash_01.png"} +#' } +#' #' @inheritParams ggplot2::geom_area #' @param geom Use to override the default Geom #' @param ab half-open interval for bins \emph{[a,b)}. If no value is specified, diff --git a/R/geom_bkde.r b/R/geom_bkde.r index fc4edae..aa61267 100644 --- a/R/geom_bkde.r +++ b/R/geom_bkde.r @@ -3,6 +3,12 @@ #' A kernel density estimate, useful for display the distribution of variables #' with underlying smoothness. #' +#' \if{html}{ +#' A sample of the output from \code{geom_bkde()}: +#' +#' \figure{geom_bkde_01.png}{options: width="100\%" alt="Figure: geom_bkde_01.png"} +#' } +#' #' @section Aesthetics: #' \code{geom_bkde} understands the following aesthetics (required aesthetics #' are in bold): diff --git a/R/geom_bkde2d.r b/R/geom_bkde2d.r index e43978c..efad35c 100644 --- a/R/geom_bkde2d.r +++ b/R/geom_bkde2d.r @@ -9,9 +9,9 @@ #' xlim(0.5, 6) + #' ylim(40, 110) #' -#' m + geom_bkde2d(bandwidth=c(0.5, 5)) +#' m + geom_bkde2d(bandwidth=c(0.5, 4)) #' -#' m + stat_bkde2d(bandwidth=c(0.5, 5), aes(fill = ..level..), geom = "polygon") +#' m + stat_bkde2d(bandwidth=c(0.5, 4), aes(fill = ..level..), geom = "polygon") #' #' # If you map an aesthetic to a categorical variable, you will get a #' # set of contours for each value of that variable @@ -71,6 +71,12 @@ GeomBkde2d <- ggproto("GeomBkde2d", GeomPath, #' Perform a 2D kernel density estimation using \code{bkde2D} and display the #' results with contours. This can be useful for dealing with overplotting #' +#' \if{html}{ +#' A sample of the output from \code{geom_bkde2d()}: +#' +#' \figure{geom_bkde2d_01.png}{options: width="100\%" alt="Figure: geom_bkde2d_01.png"} +#' } +#' #' @param bandwidth the kernel bandwidth smoothing parameter. see #' \code{\link[KernSmooth]{bkde2D}} for details. If \code{NULL}, #' it will be computed for you but will most likely not yield optimal diff --git a/R/geom_xspline.r b/R/geom_xspline.r index 7462aa0..c661f11 100644 --- a/R/geom_xspline.r +++ b/R/geom_xspline.r @@ -4,6 +4,12 @@ #' Patterned after \code{geom_line} in that it orders the points by \code{x} #' first before computing the splines. #' +#' \if{html}{ +#' A sample of the output from \code{geom_xspline()}: +#' +#' \figure{geom_xspline_01.png}{options: width="100\%" alt="Figure: geom_xspline_01.png"} +#' } +#' #' @section Aesthetics: #' \code{geom_xspline} understands the following aesthetics (required aesthetics #' are in bold): diff --git a/man/coord_proj.Rd b/man/coord_proj.Rd index d36dbd9..e3a041b 100644 --- a/man/coord_proj.Rd +++ b/man/coord_proj.Rd @@ -36,6 +36,13 @@ spherical, onto a flat 2D plane requires a projection. This is what \code{coord_proj} does, using the \code{proj4::project()} function from the \code{proj4} package. } +\details{ +\if{html}{ +A sample of the output from \code{coord_proj()} using the Winkel-Tripel projection: + +\figure{coord_proj_01.png}{options: width="100\%" alt="Figure: coord_proj_01.png"} +} +} \note{ When \code{inverse} is \code{FALSE} \code{coord_proj} makes a fairly large assumption that the coordinates being transformed are within diff --git a/man/figures/coord_proj_01.png b/man/figures/coord_proj_01.png new file mode 100644 index 0000000..9da7ef1 Binary files /dev/null and b/man/figures/coord_proj_01.png differ diff --git a/man/figures/geom_bkde2d_01.png b/man/figures/geom_bkde2d_01.png new file mode 100644 index 0000000..a42b59a Binary files /dev/null and b/man/figures/geom_bkde2d_01.png differ diff --git a/man/figures/geom_bkde_01.png b/man/figures/geom_bkde_01.png new file mode 100644 index 0000000..d7b055e Binary files /dev/null and b/man/figures/geom_bkde_01.png differ diff --git a/man/figures/geom_xspline_01.png b/man/figures/geom_xspline_01.png new file mode 100644 index 0000000..60abb46 Binary files /dev/null and b/man/figures/geom_xspline_01.png differ diff --git a/man/figures/stat_ash_01.png b/man/figures/stat_ash_01.png new file mode 100644 index 0000000..5650e3d Binary files /dev/null and b/man/figures/stat_ash_01.png differ diff --git a/man/geom_bkde.Rd b/man/geom_bkde.Rd index 8e7e208..42f00f7 100644 --- a/man/geom_bkde.Rd +++ b/man/geom_bkde.Rd @@ -78,6 +78,13 @@ for details} A kernel density estimate, useful for display the distribution of variables with underlying smoothness. } +\details{ +\if{html}{ +A sample of the output from \code{geom_bkde()}: + +\figure{geom_bkde_01.png}{options: width="100\%" alt="Figure: geom_bkde_01.png"} +} +} \section{Aesthetics}{ \code{geom_bkde} understands the following aesthetics (required aesthetics diff --git a/man/geom_bkde2d.Rd b/man/geom_bkde2d.Rd index 51550e2..9efa25f 100644 --- a/man/geom_bkde2d.Rd +++ b/man/geom_bkde2d.Rd @@ -88,6 +88,13 @@ Contours from a 2d density estimate. Perform a 2D kernel density estimation using \code{bkde2D} and display the results with contours. This can be useful for dealing with overplotting } +\details{ +\if{html}{ +A sample of the output from \code{geom_bkde2d()}: + +\figure{geom_bkde2d_01.png}{options: width="100\%" alt="Figure: geom_bkde2d_01.png"} +} +} \section{Computed variables}{ Same as \code{\link{stat_contour}} @@ -98,9 +105,9 @@ m <- ggplot(faithful, aes(x = eruptions, y = waiting)) + xlim(0.5, 6) + ylim(40, 110) -m + geom_bkde2d(bandwidth=c(0.5, 5)) +m + geom_bkde2d(bandwidth=c(0.5, 4)) -m + stat_bkde2d(bandwidth=c(0.5, 5), aes(fill = ..level..), geom = "polygon") +m + stat_bkde2d(bandwidth=c(0.5, 4), aes(fill = ..level..), geom = "polygon") # If you map an aesthetic to a categorical variable, you will get a # set of contours for each value of that variable diff --git a/man/geom_xspline.Rd b/man/geom_xspline.Rd index f45b212..f93aeab 100644 --- a/man/geom_xspline.Rd +++ b/man/geom_xspline.Rd @@ -70,6 +70,13 @@ Patterned after \code{geom_line} in that it orders the points by \code{x} first before computing the splines. } \details{ +\if{html}{ +A sample of the output from \code{geom_xspline()}: + +\figure{geom_xspline_01.png}{options: width="100\%" alt="Figure: geom_xspline_01.png"} +} + + An X-spline is a line drawn relative to control points. For each control point, the line may pass through (interpolate) the control point or it may only approach (approximate) the control point; the behaviour is determined diff --git a/man/stat_ash.Rd b/man/stat_ash.Rd index 7da1ae1..be581b1 100644 --- a/man/stat_ash.Rd +++ b/man/stat_ash.Rd @@ -61,6 +61,13 @@ the default plot specification, e.g. \code{\link{borders}}.} \description{ See \code{\link[ash]{bin1}} & \code{\link[ash]{ash1}} for more information. } +\details{ +\if{html}{ +A sample of the output from \code{stat_ash()}: + +\figure{stat_ash_01.png}{options: width="100\%" alt="Figure: stat_ash_01.png"} +} +} \section{Aesthetics}{ \code{geom_ash} understands the following aesthetics (required aesthetics