Browse Source

geom_stateface

pull/6/head
Bob Rudis 8 years ago
parent
commit
191c3ce07d
  1. 29
      DESCRIPTION
  2. 9
      NAMESPACE
  3. 6
      R/ggalt-package.r
  4. 16
      R/pokemon.r
  5. 133
      R/stateface.r
  6. 11
      R/zzz.r
  7. BIN
      inst/fonts/stateface-regular-webfont.ttf
  8. 34
      man/geom_bkde.Rd
  9. 34
      man/geom_bkde2d.Rd
  10. 67
      man/geom_stateface.Rd
  11. 34
      man/geom_xspline.Rd
  12. 3
      man/ggalt-ggproto.Rd
  13. 3
      man/ggalt.Rd
  14. 9
      man/list_avatars.Rd
  15. 12
      man/load_stateface.Rd
  16. 8
      man/pokemon_pal.Rd
  17. 7
      man/scale_pokemon.Rd
  18. 14
      man/show_stateface.Rd
  19. 34
      man/stat_ash.Rd

29
DESCRIPTION

@ -1,24 +1,30 @@
Package: ggalt Package: ggalt
Title: Extra Coordinate Systems, 'Geoms', Statistical Transformations and Scales for 'ggplot2' Title: Extra Coordinate Systems, 'Geoms', Statistical Transformations, Scales and
Version: 0.1.5.9000 Fonts for 'ggplot2'
Authors@R: c(person("Bob", "Rudis", email = "bob@rudis.net", role = c("aut", "cre"))) Version: 0.2.0.9000
Description: A compendium of 'geoms', 'coords', 'stats' & scales for 'ggplot2', Authors@R: c(
including splines, 1d and 2d densities, univariate average shifted histograms person("Bob", "Rudis", email = "bob@rudis.net", role = c("aut", "cre")),
and a new map coordinate system based on the 'PROJ.4'-library. person("Ingemar", role="dtc", comment="Pokémon javascript color palette"),
Depends: person("ProPublica", role="dtc", comment="StateFace font")
R (>= 3.0.0), )
ggplot2 (>= 2.0.0) Description: A compendium of 'geoms', 'coords', 'stats', scales and fonts for 'ggplot2',
including splines, 1d and 2d densities, univariate average shifted histograms,
a new map coordinate system based on the 'PROJ.4'-library and the 'StateFace'
open source font 'ProPublica'.
License: AGPL + file LICENSE License: AGPL + file LICENSE
LazyData: true LazyData: true
URL: https://github.com/hrbrmstr/ggalt URL: https://github.com/hrbrmstr/ggalt
BugReports: https://github.com/hrbrmstr/ggalt/issues BugReports: https://github.com/hrbrmstr/ggalt/issues
Encoding: UTF-8
Depends:
R (>= 3.0.0),
ggplot2 (>= 2.0.0)
Suggests: Suggests:
testthat, testthat,
gridExtra, gridExtra,
knitr, knitr,
rmarkdown, rmarkdown,
ggthemes, ggthemes,
Encoding: UTF-8
Imports: Imports:
graphics, graphics,
grDevices, grDevices,
@ -31,6 +37,7 @@ Imports:
gtable, gtable,
ash, ash,
maps, maps,
MASS MASS,
extrafont
RoxygenNote: 5.0.1 RoxygenNote: 5.0.1
VignetteBuilder: knitr VignetteBuilder: knitr

9
NAMESPACE

@ -8,6 +8,7 @@ S3method(grobY,absoluteGrob)
export(CoordProj) export(CoordProj)
export(GeomBkde) export(GeomBkde)
export(GeomBkde2d) export(GeomBkde2d)
export(GeomStateface)
export(GeomXspline) export(GeomXspline)
export(StatAsh) export(StatAsh)
export(StatBkde) export(StatBkde)
@ -16,12 +17,15 @@ export(StatXspline)
export(coord_proj) export(coord_proj)
export(geom_bkde) export(geom_bkde)
export(geom_bkde2d) export(geom_bkde2d)
export(geom_stateface)
export(geom_xspline) export(geom_xspline)
export(list_avatars) export(list_avatars)
export(load_stateface)
export(pokemon_pal) export(pokemon_pal)
export(scale_color_pokemon) export(scale_color_pokemon)
export(scale_colour_pokemon) export(scale_colour_pokemon)
export(scale_fill_pokemon) export(scale_fill_pokemon)
export(show_stateface)
export(stat_ash) export(stat_ash)
export(stat_bkde) export(stat_bkde)
export(stat_bkde2d) export(stat_bkde2d)
@ -36,8 +40,12 @@ import(maps)
import(proj4) import(proj4)
importFrom(RColorBrewer,brewer.pal) importFrom(RColorBrewer,brewer.pal)
importFrom(dplyr,filter) importFrom(dplyr,filter)
importFrom(extrafont,fonts)
importFrom(extrafont,loadfonts)
importFrom(extrafont,ttf_import)
importFrom(grid,gList) importFrom(grid,gList)
importFrom(grid,gTree) importFrom(grid,gTree)
importFrom(grid,gpar)
importFrom(grid,grid.draw) importFrom(grid,grid.draw)
importFrom(grid,grobHeight) importFrom(grid,grobHeight)
importFrom(grid,grobName) importFrom(grid,grobName)
@ -45,6 +53,7 @@ importFrom(grid,grobTree)
importFrom(grid,grobWidth) importFrom(grid,grobWidth)
importFrom(grid,grobX) importFrom(grid,grobX)
importFrom(grid,grobY) importFrom(grid,grobY)
importFrom(grid,textGrob)
importFrom(grid,unit.c) importFrom(grid,unit.c)
importFrom(grid,viewport) importFrom(grid,viewport)
importFrom(gtable,gtable_col) importFrom(gtable,gtable_col)

6
R/ggalt-package.r

@ -1,6 +1,7 @@
#' Extra Geoms, Stats and Coords for 'ggplot2' #' Extra Geoms, Stats and Coords for 'ggplot2'
#' #'
#' A package containing additional geoms, coords and stats for the ggplot2 2.0+ #' A package containing additional geoms, coords, stats, scales & fonts
#' for ggplot2 2.0+
#' #'
#' @name ggalt #' @name ggalt
#' @docType package #' @docType package
@ -9,7 +10,8 @@
#' @importFrom dplyr filter #' @importFrom dplyr filter
#' @importFrom scales rescale expand_range #' @importFrom scales rescale expand_range
#' @importFrom grid grobName grobTree unit.c grobHeight grobWidth viewport #' @importFrom grid grobName grobTree unit.c grobHeight grobWidth viewport
#' grid.draw grobX grobY gTree gList #' grid.draw grobX grobY gTree gList textGrob gpar
#' @importFrom gtable gtable_col gtable_height gtable_width gtable_row gtable_col #' @importFrom gtable gtable_col gtable_height gtable_width gtable_row gtable_col
#' @importFrom RColorBrewer brewer.pal #' @importFrom RColorBrewer brewer.pal
#' @importFrom extrafont loadfonts fonts ttf_import
NULL NULL

16
R/pokemon.r

@ -2,8 +2,8 @@
#' #'
#' Color scales using the colors in the Pokemon characters #' Color scales using the colors in the Pokemon characters
#' #'
#' Data taken from the hard work by the \href{http://www.pokegraphs.com/}{folks here}. #' @references \href{http://www.pokegraphs.com/}{Original JSON color list}.
#' #' @note Pokémon & Pokémon character names are trademarks of Nintendo.
#' @inheritParams ggplot2::scale_colour_hue #' @inheritParams ggplot2::scale_colour_hue
#' @inheritParams pokemon_pal #' @inheritParams pokemon_pal
#' @family colour pokemon #' @family colour pokemon
@ -23,11 +23,10 @@ scale_fill_pokemon <- function(avatar=FALSE, ...) {
discrete_scale("fill", "pokemon", pokemon_pal(avatar=avatar), ...) discrete_scale("fill", "pokemon", pokemon_pal(avatar=avatar), ...)
} }
#' Pick a Pokemon palette #' Pick a Pokemon palette
#' #'
#' Data taken from the hard work by the \href{http://www.pokegraphs.com/}{folks here}. #' @references \href{http://www.pokegraphs.com/}{Original JSON color list}.
#' #' @note Pokémon & Pokémon character names are trademarks of Nintendo.
#' @param avatar avatar name. Use \code{list_avatars()} to see them all! #' @param avatar avatar name. Use \code{list_avatars()} to see them all!
#' @export #' @export
pokemon_pal <- function(avatar="bulbasaur") { pokemon_pal <- function(avatar="bulbasaur") {
@ -51,9 +50,10 @@ pokemon_pal <- function(avatar="bulbasaur") {
#' List Pokemon avatar names #' List Pokemon avatar names
#' #'
#' Data taken from the hard work by the \href{http://www.pokegraphs.com/}{folks here}. #' @references \href{http://www.pokegraphs.com/}{Original JSON color list}.
#' #' @note Warning: huge! list\cr
#' @note Warning: huge! list #' \cr
#' Pokémon & Pokémon character names are trademarks of Nintendo.
#' @export #' @export
list_avatars <- function() { list_avatars <- function() {
sort(names(pokemon)) sort(names(pokemon))

133
R/stateface.r

@ -0,0 +1,133 @@
state_trans <- c(AL='B', AK='A', AZ='D', AR='C', CA='E', CO='F', CT='G',
DE='H', DC='y', FL='I', GA='J', HI='K', ID='M', IL='N',
IN='O', IA='L', KS='P', KY='Q', LA='R', ME='U', MD='T',
MA='S', MI='V', MN='W', MS='Y', MO='X', MT='Z', NE='c',
NV='g', NH='d', NJ='e', NM='f', NY='h', NC='a', ND='b',
OH='i', OK='j', OR='k', PA='l', RI='m', SC='n', SD='o',
TN='p', TX='q', UT='r', VT='t', VA='s', WA='u', WV='w',
WI='v', WY='x', US='z')
state_tbl <- setNames(toupper(state.abb), tolower(state.name))
#' Show location of StateFace font
#'
#' Displays the path to the StateFace font. For the font to work
#' in the on-screen plot device for ggplot2, you need to install
#' the font on your system
#' @export
show_stateface <- function() {
system.file("fonts/", package="ggalt")
}
#' Load stateface font
#'
#' @export
load_stateface <- function() {
if (!any(grepl("StateFace", extrafont::fonts()))) {
tmp <- capture.output(suppressWarnings(extrafont::ttf_import(
system.file("fonts/", package="ggalt"),
prompt=FALSE, pattern="*.ttf", recursive=FALSE)))
}
tmp <- capture.output(suppressWarnings(extrafont::loadfonts(quiet=TRUE)))
}
#' Use ProPublica's StateFace font in ggplot2 plots
#'
#' @inheritParams ggplot2::geom_text
#' @export
geom_stateface <- function(mapping = NULL, data = NULL, stat = "identity",
position = "identity", ..., parse = FALSE,
nudge_x = 0, nudge_y = 0, check_overlap = FALSE,
na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) {
if (!missing(nudge_x) || !missing(nudge_y)) {
if (!missing(position)) {
stop("Specify either `position` or `nudge_x`/`nudge_y`", call. = FALSE)
}
position <- position_nudge(nudge_x, nudge_y)
}
layer(
data = data,
mapping = mapping,
stat = stat,
geom = GeomStateface,
position = position,
show.legend = show.legend,
inherit.aes = inherit.aes,
params = list(
parse = parse,
check_overlap = check_overlap,
na.rm = na.rm,
...
)
)
}
#' @rdname ggalt-ggproto
#' @format NULL
#' @usage NULL
#' @export
GeomStateface <- ggproto("GeomStateface", Geom,
required_aes = c("x", "y", "label"),
default_aes = aes(
colour = "black", size = 3.88, angle = 0, hjust = 0.5,
vjust = 0.5, alpha = NA, family = "", fontface = 1, lineheight = 1.2
),
draw_panel = function(data, panel_scales, coord, parse = FALSE,
na.rm = FALSE, check_overlap = FALSE) {
lab <- data$label
if (max(sapply(lab, nchar)) == 2) {
lab <- unname(state_trans[toupper(lab)])
} else {
lab <- unname(state_trans[state_tbl[tolower(lab)]])
}
data <- coord$transform(data, panel_scales)
if (is.character(data$vjust)) {
data$vjust <- compute_just(data$vjust, data$y)
}
if (is.character(data$hjust)) {
data$hjust <- compute_just(data$hjust, data$x)
}
textGrob(
lab,
data$x, data$y, default.units = "native",
hjust = data$hjust, vjust = data$vjust,
rot = data$angle,
gp = gpar(
col = alpha(data$colour, data$alpha),
fontsize = data$size * .pt,
fontfamily = "StateFace",
fontface = data$fontface,
lineheight = data$lineheight
),
check.overlap = check_overlap
)
},
draw_key = draw_key_text
)
compute_just <- function(just, x) {
inward <- just == "inward"
just[inward] <- c("left", "middle", "right")[just_dir(x[inward])]
outward <- just == "outward"
just[outward] <- c("right", "middle", "left")[just_dir(x[outward])]
unname(c(left = 0, center = 0.5, right = 1,
bottom = 0, middle = 0.5, top = 1)[just])
}
just_dir <- function(x, tol = 0.001) {
out <- rep(2L, length(x))
out[x < 0.5 - tol] <- 1L
out[x > 0.5 + tol] <- 3L
out
}

11
R/zzz.r

@ -0,0 +1,11 @@
.onAttach <- function(...) {
if (!interactive()) return()
load_stateface()
packageStartupMessage(paste0("ggalt is under *active* development. ",
"See https://github.com/hrbrmstr/ggalt for changes"))
}

BIN
inst/fonts/stateface-regular-webfont.ttf

Binary file not shown.

34
man/geom_bkde.Rd

@ -17,12 +17,22 @@ stat_bkde(mapping = NULL, data = NULL, geom = "area",
\arguments{ \arguments{
\item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or \item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or
\code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the \code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the
default), is combined with the default mapping at the top level of the default), it is combined with the default mapping at the top level of the
plot. You only need to supply \code{mapping} if there isn't a mapping plot. You must supply \code{mapping} if there is no plot mapping.}
defined for the plot.}
\item{data}{A data frame. If specified, overrides the default data frame \item{data}{The data to be displayed in this layer. There are three
defined at the top level of the plot.} options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
A \code{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link{fortify}} for which variables will be created.
A \code{function} will be called with a single argument,
the plot data. The return value must be a \code{data.frame.}, and
will be used as the layer data.}
\item{position}{Position adjustment, either as a string, or the result of \item{position}{Position adjustment, either as a string, or the result of
a call to a position adjustment function.} a call to a position adjustment function.}
@ -47,16 +57,10 @@ rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from that define both data and aesthetics and shouldn't inherit behaviour from
the default plot specification, e.g. \code{\link{borders}}.} the default plot specification, e.g. \code{\link{borders}}.}
\item{...}{other arguments passed on to \code{\link{layer}}. There are \item{...}{other arguments passed on to \code{\link{layer}}. These are
three types of arguments you can use here: often aesthetics, used to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}. They may also be parameters
\itemize{ to the paired geom/stat.}
\item Aesthetics: to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}.
\item Other arguments to the layer, for example you override the
default \code{stat} associated with the layer.
\item Other arguments passed on to the stat.
}}
\item{geom, stat}{Use to override the default connection between \item{geom, stat}{Use to override the default connection between
\code{geom_bkde} and \code{stat_bkde}.} \code{geom_bkde} and \code{stat_bkde}.}

34
man/geom_bkde2d.Rd

@ -18,12 +18,22 @@ stat_bkde2d(mapping = NULL, data = NULL, geom = "density2d",
\arguments{ \arguments{
\item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or \item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or
\code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the \code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the
default), is combined with the default mapping at the top level of the default), it is combined with the default mapping at the top level of the
plot. You only need to supply \code{mapping} if there isn't a mapping plot. You must supply \code{mapping} if there is no plot mapping.}
defined for the plot.}
\item{data}{A data frame. If specified, overrides the default data frame \item{data}{The data to be displayed in this layer. There are three
defined at the top level of the plot.} options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
A \code{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link{fortify}} for which variables will be created.
A \code{function} will be called with a single argument,
the plot data. The return value must be a \code{data.frame.}, and
will be used as the layer data.}
\item{stat}{The statistical transformation to use on the data for this \item{stat}{The statistical transformation to use on the data for this
layer, as a string.} layer, as a string.}
@ -61,16 +71,10 @@ rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from that define both data and aesthetics and shouldn't inherit behaviour from
the default plot specification, e.g. \code{\link{borders}}.} the default plot specification, e.g. \code{\link{borders}}.}
\item{...}{other arguments passed on to \code{\link{layer}}. There are \item{...}{other arguments passed on to \code{\link{layer}}. These are
three types of arguments you can use here: often aesthetics, used to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}. They may also be parameters
\itemize{ to the paired geom/stat.}
\item Aesthetics: to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}.
\item Other arguments to the layer, for example you override the
default \code{stat} associated with the layer.
\item Other arguments passed on to the stat.
}}
\item{geom}{default geom to use with this stat} \item{geom}{default geom to use with this stat}

67
man/geom_stateface.Rd

@ -0,0 +1,67 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stateface.r
\name{geom_stateface}
\alias{geom_stateface}
\title{Use ProPublica's StateFace font in ggplot2 plots}
\usage{
geom_stateface(mapping = NULL, data = NULL, stat = "identity",
position = "identity", ..., parse = FALSE, nudge_x = 0, nudge_y = 0,
check_overlap = FALSE, na.rm = FALSE, show.legend = NA,
inherit.aes = TRUE)
}
\arguments{
\item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or
\code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the
default), it is combined with the default mapping at the top level of the
plot. You must supply \code{mapping} if there is no plot mapping.}
\item{data}{The data to be displayed in this layer. There are three
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
A \code{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link{fortify}} for which variables will be created.
A \code{function} will be called with a single argument,
the plot data. The return value must be a \code{data.frame.}, and
will be used as the layer data.}
\item{stat}{The statistical transformation to use on the data for this
layer, as a string.}
\item{position}{Position adjustment, either as a string, or the result of
a call to a position adjustment function.}
\item{...}{other arguments passed on to \code{\link{layer}}. These are
often aesthetics, used to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}. They may also be parameters
to the paired geom/stat.}
\item{parse}{If TRUE, the labels will be parsed into expressions and
displayed as described in ?plotmath}
\item{nudge_x}{Horizontal and vertical adjustment to nudge labels by.
Useful for offsetting text from points, particularly on discrete scales.}
\item{check_overlap}{If \code{TRUE}, text that overlaps previous text in the
same layer will not be plotted. A quick and dirty way}
\item{na.rm}{If \code{FALSE} (the default), removes missing values with
a warning. If \code{TRUE} silently removes missing values.}
\item{show.legend}{logical. Should this layer be included in the legends?
\code{NA}, the default, includes if any aesthetics are mapped.
\code{FALSE} never includes, and \code{TRUE} always includes.}
\item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics,
rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from
the default plot specification, e.g. \code{\link{borders}}.}
}
\description{
Use ProPublica's StateFace font in ggplot2 plots
}

34
man/geom_xspline.Rd

@ -18,12 +18,22 @@ stat_xspline(mapping = NULL, data = NULL, geom = "line",
\arguments{ \arguments{
\item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or \item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or
\code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the \code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the
default), is combined with the default mapping at the top level of the default), it is combined with the default mapping at the top level of the
plot. You only need to supply \code{mapping} if there isn't a mapping plot. You must supply \code{mapping} if there is no plot mapping.}
defined for the plot.}
\item{data}{A data frame. If specified, overrides the default data frame \item{data}{The data to be displayed in this layer. There are three
defined at the top level of the plot.} options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
A \code{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link{fortify}} for which variables will be created.
A \code{function} will be called with a single argument,
the plot data. The return value must be a \code{data.frame.}, and
will be used as the layer data.}
\item{position}{Position adjustment, either as a string, or the result of \item{position}{Position adjustment, either as a string, or the result of
a call to a position adjustment function.} a call to a position adjustment function.}
@ -50,16 +60,10 @@ closed shape.}
first and last control points should be replicated for drawing the first and last control points should be replicated for drawing the
curve. Ignored for closed X-splines.} curve. Ignored for closed X-splines.}
\item{...}{other arguments passed on to \code{\link{layer}}. There are \item{...}{other arguments passed on to \code{\link{layer}}. These are
three types of arguments you can use here: often aesthetics, used to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}. They may also be parameters
\itemize{ to the paired geom/stat.}
\item Aesthetics: to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}.
\item Other arguments to the layer, for example you override the
default \code{stat} associated with the layer.
\item Other arguments passed on to the stat.
}}
\item{geom, stat}{Use to override the default connection between \item{geom, stat}{Use to override the default connection between
\code{geom_xspline} and \code{stat_xspline}.} \code{geom_xspline} and \code{stat_xspline}.}

3
man/ggalt-ggproto.Rd

@ -1,10 +1,11 @@
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/coord_proj.r, R/geom_ash.r, R/geom_bkde.r, R/geom_bkde2d.r, R/geom_xspline.r % Please edit documentation in R/coord_proj.r, R/geom_ash.r, R/geom_bkde.r, R/geom_bkde2d.r, R/geom_xspline.r, R/stateface.r
\docType{data} \docType{data}
\name{CoordProj} \name{CoordProj}
\alias{CoordProj} \alias{CoordProj}
\alias{GeomBkde} \alias{GeomBkde}
\alias{GeomBkde2d} \alias{GeomBkde2d}
\alias{GeomStateface}
\alias{GeomXspline} \alias{GeomXspline}
\alias{StatAsh} \alias{StatAsh}
\alias{StatBkde} \alias{StatBkde}

3
man/ggalt.Rd

@ -6,7 +6,8 @@
\alias{ggalt-package} \alias{ggalt-package}
\title{Extra Geoms, Stats and Coords for 'ggplot2'} \title{Extra Geoms, Stats and Coords for 'ggplot2'}
\description{ \description{
A package containing additional geoms, coords and stats for the ggplot2 2.0+ A package containing additional geoms, coords, stats, scales & fonts
for ggplot2 2.0+
} }
\author{ \author{
Bob Rudis (@hrbrmstr) Bob Rudis (@hrbrmstr)

9
man/list_avatars.Rd

@ -7,9 +7,14 @@
list_avatars() list_avatars()
} }
\description{ \description{
Data taken from the hard work by the \href{http://www.pokegraphs.com/}{folks here}. List Pokemon avatar names
} }
\note{ \note{
Warning: huge! list Warning: huge! list\cr
\cr
Pokémon & Pokémon character names are trademarks of Nintendo.
}
\references{
\href{http://www.pokegraphs.com/}{Original JSON color list}.
} }

12
man/load_stateface.Rd

@ -0,0 +1,12 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stateface.r
\name{load_stateface}
\alias{load_stateface}
\title{Load stateface font}
\usage{
load_stateface()
}
\description{
Load stateface font
}

8
man/pokemon_pal.Rd

@ -10,6 +10,12 @@ pokemon_pal(avatar = "bulbasaur")
\item{avatar}{avatar name. Use \code{list_avatars()} to see them all!} \item{avatar}{avatar name. Use \code{list_avatars()} to see them all!}
} }
\description{ \description{
Data taken from the hard work by the \href{http://www.pokegraphs.com/}{folks here}. Pick a Pokemon palette
}
\note{
Pokémon & Pokémon character names are trademarks of Nintendo.
}
\references{
\href{http://www.pokegraphs.com/}{Original JSON color list}.
} }

7
man/scale_pokemon.Rd

@ -21,7 +21,10 @@ to control name, limits, breaks, labels and so forth.}
\description{ \description{
Color scales using the colors in the Pokemon characters Color scales using the colors in the Pokemon characters
} }
\details{ \note{
Data taken from the hard work by the \href{http://www.pokegraphs.com/}{folks here}. Pokémon & Pokémon character names are trademarks of Nintendo.
}
\references{
\href{http://www.pokegraphs.com/}{Original JSON color list}.
} }

14
man/show_stateface.Rd

@ -0,0 +1,14 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stateface.r
\name{show_stateface}
\alias{show_stateface}
\title{Show location of StateFace font}
\usage{
show_stateface()
}
\description{
Displays the path to the StateFace font. For the font to work
in the on-screen plot device for ggplot2, you need to install
the font on your system
}

34
man/stat_ash.Rd

@ -11,12 +11,22 @@ stat_ash(mapping = NULL, data = NULL, geom = "area", position = "stack",
\arguments{ \arguments{
\item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or \item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or
\code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the \code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the
default), is combined with the default mapping at the top level of the default), it is combined with the default mapping at the top level of the
plot. You only need to supply \code{mapping} if there isn't a mapping plot. You must supply \code{mapping} if there is no plot mapping.}
defined for the plot.}
\item{data}{A data frame. If specified, overrides the default data frame \item{data}{The data to be displayed in this layer. There are three
defined at the top level of the plot.} options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
A \code{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link{fortify}} for which variables will be created.
A \code{function} will be called with a single argument,
the plot data. The return value must be a \code{data.frame.}, and
will be used as the layer data.}
\item{geom}{Use to override the default Geom} \item{geom}{Use to override the default Geom}
@ -47,16 +57,10 @@ rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from that define both data and aesthetics and shouldn't inherit behaviour from
the default plot specification, e.g. \code{\link{borders}}.} the default plot specification, e.g. \code{\link{borders}}.}
\item{...}{other arguments passed on to \code{\link{layer}}. There are \item{...}{other arguments passed on to \code{\link{layer}}. These are
three types of arguments you can use here: often aesthetics, used to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}. They may also be parameters
\itemize{ to the paired geom/stat.}
\item Aesthetics: to set an aesthetic to a fixed value, like
\code{color = "red"} or \code{size = 3}.
\item Other arguments to the layer, for example you override the
default \code{stat} associated with the layer.
\item Other arguments passed on to the stat.
}}
} }
\description{ \description{
See \code{\link[ash]{bin1}} & \code{\link[ash]{ash1}} for more information. See \code{\link[ash]{bin1}} & \code{\link[ash]{ash1}} for more information.

Loading…
Cancel
Save