No known key found for this signature in database
GPG Key ID: 2A514A4997464560
5 changed files with
10 additions and
16 deletions
-
DESCRIPTION
-
R/geom_ubar.r
-
R/stateface.r
-
README.Rmd
-
man/geom_ubar.Rd
|
|
@ -1,7 +1,7 @@ |
|
|
|
Package: ggalt |
|
|
|
Title: Extra Coordinate Systems, 'Geoms', Statistical Transformations, Scales |
|
|
|
and Fonts for 'ggplot2' |
|
|
|
Version: 0.5.0 |
|
|
|
Version: 0.6.0 |
|
|
|
Maintainer: Bob Rudis <bob@rud.is> |
|
|
|
Authors@R: c( |
|
|
|
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre")), |
|
|
|
|
|
@ -5,9 +5,6 @@ |
|
|
|
#' constant without any tricks and you have granular control over the |
|
|
|
#' segment width. I decided it was time to make a `geom`. |
|
|
|
#' |
|
|
|
#' Dumbbell dot plots — dot plots with two or more series of data — are an |
|
|
|
#' alternative to the clustered bar chart or slope graph. |
|
|
|
#' |
|
|
|
#' @md |
|
|
|
#' @section Aesthetics: |
|
|
|
#' `geom_ubar`` understands the following aesthetics (required aesthetics are in bold): |
|
|
@ -30,11 +27,11 @@ |
|
|
|
#' @inheritParams ggplot2::layer |
|
|
|
#' @export |
|
|
|
#' @examples |
|
|
|
#' library(ggplot2) |
|
|
|
#' |
|
|
|
#' data(economics) |
|
|
|
#' ggplot(economics, aes(date, uempmed)) + |
|
|
|
#' geom_ubar() |
|
|
|
# library(ggplot2) |
|
|
|
# |
|
|
|
# data(economics) |
|
|
|
# ggplot(economics, aes(date, uempmed)) + |
|
|
|
# geom_ubar() |
|
|
|
geom_ubar <- function(mapping = NULL, data = NULL, stat = "identity", |
|
|
|
position = "identity", ..., |
|
|
|
na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) { |
|
|
|
|
|
@ -48,7 +48,7 @@ load_stateface <- function() { |
|
|
|
system.file("fonts/", package="ggalt"), |
|
|
|
prompt=FALSE, pattern="*.ttf", recursive=FALSE))) |
|
|
|
} |
|
|
|
tmp <- capture.output(suppressWarnings(extrafont::loadfonts(quiet=TRUE))) |
|
|
|
tmp <- utils::capture.output(suppressWarnings(extrafont::loadfonts(quiet=TRUE))) |
|
|
|
} |
|
|
|
|
|
|
|
#' Use ProPublica's StateFace font in ggplot2 plots |
|
|
|
|
|
@ -25,8 +25,9 @@ The following functions are implemented: |
|
|
|
- `geom_xspline` : Connect control points/observations with an X-spline |
|
|
|
- `stat_xspline` : Connect control points/observations with an X-spline |
|
|
|
- `geom_bkde` : Display a smooth density estimate (uses `KernSmooth::bkde`) |
|
|
|
- `geom_stateface`: Use ProPublica's StateFace font in ggplot2 plots- `stat_bkde` : Display a smooth density estimate (uses `KernSmooth::bkde`) |
|
|
|
- `geom_bkde2d` : Contours from a 2d density estimate. (uses `KernSmooth::bkde2D`) |
|
|
|
- `geom_stateface`: Use ProPublica's StateFace font in ggplot2 plots |
|
|
|
- `geom_bkde2d` : Contours from a 2d density estimate. (uses `KernSmooth::bkde2D`) |
|
|
|
- `stat_bkde` : Display a smooth density estimate (uses `KernSmooth::bkde`) |
|
|
|
- `stat_bkde2d` : Contours from a 2d density estimate. (uses `KernSmooth::bkde2D`) |
|
|
|
- `stat_ash` : Compute and display a univariate averaged shifted histogram (polynomial kernel) (uses `ash::ash1`/`ash::bin1`) |
|
|
|
- `geom_encircle`: Automatically enclose points in a polygon |
|
|
|
|
|
@ -59,10 +59,6 @@ I've been using \code{geom_segment} more to make "bar" charts, setting |
|
|
|
constant without any tricks and you have granular control over the |
|
|
|
segment width. I decided it was time to make a \code{geom}. |
|
|
|
} |
|
|
|
\details{ |
|
|
|
Dumbbell dot plots — dot plots with two or more series of data — are an |
|
|
|
alternative to the clustered bar chart or slope graph. |
|
|
|
} |
|
|
|
\section{Aesthetics}{ |
|
|
|
|
|
|
|
`geom_ubar`` understands the following aesthetics (required aesthetics are in bold): |
|
|
|