Browse Source

add geom_spikelines

pull/50/head
yoni sidi 3 years ago
parent
commit
bfe18519bd
60 changed files with 500 additions and 202 deletions
  1. +3
    -2
      DESCRIPTION
  2. +2
    -0
      NAMESPACE
  3. +119
    -0
      R/geom_spikelines.R
  4. +15
    -1
      README.Rmd
  5. +89
    -31
      README.md
  6. BIN
      README_figs/README-annoticks-1.png
  7. BIN
      README_figs/README-annoticks-2.png
  8. BIN
      README_figs/README-annoticks-3.png
  9. BIN
      README_figs/README-bkde2d-1.png
  10. BIN
      README_figs/README-bkde2d-2.png
  11. BIN
      README_figs/README-bkde_ash-1.png
  12. BIN
      README_figs/README-bkde_ash-2.png
  13. BIN
      README_figs/README-bkde_ash-3.png
  14. BIN
      README_figs/README-bkde_ash-4.png
  15. BIN
      README_figs/README-bkde_ash-5.png
  16. BIN
      README_figs/README-bkde_ash-6.png
  17. BIN
      README_figs/README-bkde_ash-7.png
  18. BIN
      README_figs/README-bkde_ash-8.png
  19. BIN
      README_figs/README-coord_proj-1.png
  20. BIN
      README_figs/README-dumbbell-1.png
  21. BIN
      README_figs/README-dumbbell2-1.png
  22. BIN
      README_figs/README-encircle-1.png
  23. BIN
      README_figs/README-encircle-2.png
  24. BIN
      README_figs/README-encircle-3.png
  25. BIN
      README_figs/README-encircle-4.png
  26. BIN
      README_figs/README-encircle-5.png
  27. BIN
      README_figs/README-encircle-6.png
  28. BIN
      README_figs/README-encircle-7.png
  29. BIN
      README_figs/README-horizon-1.png
  30. BIN
      README_figs/README-lollipop-1.png
  31. BIN
      README_figs/README-spikelines-1.png
  32. BIN
      README_figs/README-splines-1.png
  33. BIN
      README_figs/README-splines-2.png
  34. BIN
      README_figs/README-splines-3.png
  35. BIN
      README_figs/README-splines-4.png
  36. BIN
      README_figs/README-splines-5.png
  37. BIN
      README_figs/README-splines-6.png
  38. BIN
      README_figs/README-splines-7.png
  39. BIN
      README_figs/README-splines-8.png
  40. BIN
      README_figs/README-stateface-1.png
  41. BIN
      README_figs/README-stepribbon-1.png
  42. BIN
      README_figs/README-stepribbon-2.png
  43. +3
    -3
      man/annotation_ticks.Rd
  44. +16
    -14
      man/geom_bkde.Rd
  45. +19
    -19
      man/geom_bkde2d.Rd
  46. +16
    -14
      man/geom_cartogram.Rd
  47. +15
    -13
      man/geom_dumbbell.Rd
  48. +1
    -3
      man/geom_horizon.Rd
  49. +15
    -13
      man/geom_lollipop.Rd
  50. +82
    -0
      man/geom_spikelines.Rd
  51. +18
    -15
      man/geom_stateface.Rd
  52. +15
    -13
      man/geom_ubar.Rd
  53. +17
    -14
      man/geom_xspline.Rd
  54. +17
    -14
      man/geom_xspline2.Rd
  55. +4
    -3
      man/ggalt-ggproto.Rd
  56. +0
    -2
      man/ggplot2-ggproto.Rd
  57. +1
    -0
      man/load_stateface.Rd
  58. +1
    -0
      man/show_stateface.Rd
  59. +16
    -14
      man/stat_ash.Rd
  60. +16
    -14
      man/stat_stepribbon.Rd

+ 3
- 2
DESCRIPTION View File

@ -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.1
Maintainer: Bob Rudis <bob@rud.is>
Authors@R: c(
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre")),
@ -54,7 +54,7 @@ Imports:
extrafont,
tibble,
plotly (>= 3.4.1)
RoxygenNote: 6.0.1
RoxygenNote: 6.0.1.9000
VignetteBuilder: knitr
Collate:
'annotate_textp.r'
@ -66,6 +66,7 @@ Collate:
'geom_ash.r'
'geom_bkde.r'
'geom_bkde2d.r'
'geom_spikelines.R'
'geom_dumbbell.R'
'geom_cartogram.r'
'geom_encircle.r'


+ 2
- 0
NAMESPACE View File

@ -15,6 +15,7 @@ export(GeomDumbbell)
export(GeomEncircle)
export(GeomHorizon)
export(GeomLollipop)
export(GeomSpikelines)
export(GeomStateface)
export(GeomTicks)
export(GeomUbar)
@ -40,6 +41,7 @@ export(geom_dumbbell)
export(geom_encircle)
export(geom_horizon)
export(geom_lollipop)
export(geom_spikelines)
export(geom_stateface)
export(geom_ubar)
export(geom_xspline)


+ 119
- 0
R/geom_spikelines.R View File

@ -0,0 +1,119 @@
#' @title Draw spikelines on a plot
#' @description Segment reference lines that originate at an point
#' @inheritParams ggplot2::geom_line
#' @examples
#'
#' mtcars$name <- rownames(mtcars)
#'
#' p <- ggplot(data = mtcars, aes(x=mpg,y=disp)) + geom_point()
#'
#' p + geom_spikelines(data = mtcars[mtcars$carb==4,],linetype = 2)
#'
#' p + geom_spikelines(data = mtcars[mtcars$carb==4,],aes(colour = factor(gear)), linetype = 2)
#'
#' \dontrun{
#' require(ggrepel)
#' p + geom_spikelines(data = mtcars[mtcars$carb==4,],aes(colour = factor(gear)), linetype = 2) +
#' ggrepel::geom_label_repel(data = mtcars[mtcars$carb==4,],aes(label = name))
#' }
#'
#' @rdname geom_spikelines
#' @author Jonathan Sidi
#' @export
geom_spikelines <- function(mapping = NULL, data = NULL,
stat = "identity", position = "identity",
...,
arrow = NULL,
lineend = "butt",
linejoin = "round",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE) {
layer(
data = data,
mapping = mapping,
stat = stat,
geom = GeomSpikelines,
position = position,
show.legend = show.legend,
inherit.aes = inherit.aes,
params = list(
arrow = arrow,
lineend = lineend,
linejoin = linejoin,
na.rm = na.rm,
...
)
)
}
#' @rdname ggalt-ggproto
#' @format NULL
#' @usage NULL
#' @export
GeomSpikelines <- ggproto("GeomSpikelines", Geom,
required_aes = c("x", "y"),
non_missing_aes = c("linetype", "size", "shape"),
default_aes = aes(colour = "black", size = 0.5, linetype = 1, alpha = NA),
draw_panel = function(data, panel_params, coord, arrow = NULL,
lineend = "butt", linejoin = "round", na.rm = FALSE) {
data1 <- data
data2 <- data
data1$xend <- data$x
data1$yend <- data$y
data1$y <- 0
data2$xend <- data$x
data2$yend <- data$y
data2$x <- 0
data <- rbind(data1,data2)
data <- remove_missing(data, na.rm = na.rm,
c("x", "y", "linetype", "size", "shape"),
name = "geom_spikelines")
if (empty(data)) return(zeroGrob())
if (coord$is_linear()) {
coord <- coord$transform(data, panel_params)
ret <- grid::segmentsGrob(coord$x, coord$y, coord$xend, coord$yend,
default.units = "native",
gp = grid::gpar(
col = alpha(coord$colour, coord$alpha),
fill = alpha(coord$colour, coord$alpha),
lwd = coord$size * .pt,
lty = coord$linetype,
lineend = lineend,
linejoin = linejoin
),
arrow = arrow
)
return(ret)
}
data$group <- 1:nrow(data)
starts <- subset(data, select = c(-xend, -yend))
ends <- plyr::rename(subset(data, select = c(-x, -y)), c("xend" = "x", "yend" = "y"),
warn_missing = FALSE)
pieces <- rbind(starts, ends)
pieces <- pieces[order(pieces$group),]
GeomPath$draw_panel(pieces, panel_params, coord, arrow = arrow,
lineend = lineend)
},
draw_key = draw_key_path
)
empty <- function (df)
{
is.null(df) || nrow(df) == 0 || ncol(df) == 0
}

+ 15
- 1
README.Rmd View File

@ -34,7 +34,9 @@ The following functions are implemented:
- `geom_lollipop()`: Dead easy lollipops (horizontal or vertical)
- `geom_dumbbell()` : Dead easy dumbbell plots
- `stat_stepribbon()` : Step ribbons
- `annotation_ticks()` : Add minor ticks to identity, exp(1) and exp(10) axis scales independently of each other.
- `annotation_ticks()` : Add minor ticks to identity, exp(1) and exp(10) axis scales independently of each other.
- `geom_spikelines()` : Instead of geom_vline and geom_hline a pair of segments that originate from same c(x,y) are drawn to the respective axes.
- plotly integration for a few of the ^^ geoms
### Installation
@ -422,6 +424,18 @@ p1 <- p + scale_x_log10()
p1 + annotation_ticks(sides = 'lb', scale = c('identity','log10'))
```
```{r spikelines, message=FALSE, fig.width=7, fig.height=7}
mtcars$name <- rownames(mtcars)
p <- ggplot(data = mtcars, aes(x=mpg,y=disp)) + geom_point()
p +
geom_spikelines(data = mtcars[mtcars$carb==4,],aes(colour = factor(gear)), linetype = 2) +
ggrepel::geom_label_repel(data = mtcars[mtcars$carb==4,],aes(label = name))
```
### Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md).


+ 89
- 31
README.md View File

@ -1,30 +1,72 @@
<!-- README.md is generated from README.Rmd. Please edit that file -->
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/0.1.0/active.svg)](http://www.repostatus.org/#active) [![Travis-CI Build Status](https://travis-ci.org/hrbrmstr/ggalt.svg?branch=master)](https://travis-ci.org/hrbrmstr/ggalt) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/ggalt)](https://CRAN.R-project.org/package=ggalt) ![downloads](http://cranlogs.r-pkg.org/badges/grand-total/ggalt)
`ggalt` : Extra Coordinate Systems, Geoms, Statistical Transformations, Scales & Fonts for 'ggplot2'
[![Project Status: Active - The project has reached a stable, usable
state and is being actively
developed.](http://www.repostatus.org/badges/0.1.0/active.svg)](http://www.repostatus.org/#active)
[![Travis-CI Build
Status](https://travis-ci.org/hrbrmstr/ggalt.svg?branch=master)](https://travis-ci.org/hrbrmstr/ggalt)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/ggalt)](https://CRAN.R-project.org/package=ggalt)
![downloads](http://cranlogs.r-pkg.org/badges/grand-total/ggalt)
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'.
`ggalt` : Extra Coordinate Systems, Geoms, Statistical Transformations,
Scales & Fonts for ‘ggplot2’
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’.
The following functions are implemented:
- `geom_ubar` : Uniform width bar charts
- `geom_horizon` : Horizon charts (modified from <https://github.com/AtherEnergy/ggTimeSeries>)
- `coord_proj` : Like `coord_map`, only better (prbly shld use this with `geom_cartogram` as `geom_map`'s new defaults are ugh)
- `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`)
- `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
- `byte_format`: + helpers. e.g. turn `10000` into `10 Kb`
- `geom_lollipop()`: Dead easy lollipops (horizontal or vertical)
- `geom_dumbbell()` : Dead easy dumbbell plots
- `stat_stepribbon()` : Step ribbons
- `annotation_ticks()` : Add minor ticks to identity, exp(1) and exp(10) axis scales independently of each other.
- plotly integration for a few of the ^^ geoms
- `geom_ubar` : Uniform width bar charts
- `geom_horizon` : Horizon charts (modified from
<https://github.com/AtherEnergy/ggTimeSeries>)
- `coord_proj` : Like `coord_map`, only better (prbly shld use this
with `geom_cartogram` as `geom_map`’s new defaults are ugh)
- `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`)
- `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
- `byte_format`: + helpers. e.g. turn `10000` into `10 Kb`
- `geom_lollipop()`: Dead easy lollipops (horizontal or vertical)
- `geom_dumbbell()` : Dead easy dumbbell plots
- `stat_stepribbon()` : Step ribbons
- `annotation_ticks()` : Add minor ticks to identity, exp(1) and
exp(10) axis scales independently of each other.
- `geom_spikelines()` : Instead of geom\_vline and geom\_hline a pair
of segments that originate from same c(x,y) are drawn to the
respective axes.
- plotly integration for a few of the ^^ geoms
### Installation
@ -55,7 +97,8 @@ dat <- data.frame(x=c(1:10, 1:10, 1:10),
### Horzon Chart
Example carved from: <https://github.com/halhen/viz-pub/blob/master/sports-time-of-day/2_gen_chart.R>
Example carved from:
<https://github.com/halhen/viz-pub/blob/master/sports-time-of-day/2_gen_chart.R>
``` r
library(hrbrthemes)
@ -101,7 +144,7 @@ ggplot(sports, aes(time2, p_smooth)) +
<img src="README_figs/README-horizon-1.png" width="912" />
### Splines!
### Splines\!
``` r
ggplot(dat, aes(x, y, group=group, color=group)) +
@ -117,7 +160,7 @@ ggplot(dat, aes(x, y, group=group, color=factor(group))) +
geom_point() +
geom_line() +
geom_smooth(se=FALSE, linetype="dashed", size=0.5)
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
```
<img src="README_figs/README-splines-2.png" width="672" />
@ -128,7 +171,7 @@ ggplot(dat, aes(x, y, group=group, color=factor(group))) +
geom_point(color="black") +
geom_smooth(se=FALSE, linetype="dashed", size=0.5) +
geom_xspline(size=0.5)
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
```
<img src="README_figs/README-splines-3.png" width="672" />
@ -139,7 +182,7 @@ ggplot(dat, aes(x, y, group=group, color=factor(group))) +
geom_point(color="black") +
geom_smooth(se=FALSE, linetype="dashed", size=0.5) +
geom_xspline(spline_shape=-0.4, size=0.5)
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
```
<img src="README_figs/README-splines-4.png" width="672" />
@ -150,7 +193,7 @@ ggplot(dat, aes(x, y, group=group, color=factor(group))) +
geom_point(color="black") +
geom_smooth(se=FALSE, linetype="dashed", size=0.5) +
geom_xspline(spline_shape=0.4, size=0.5)
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
```
<img src="README_figs/README-splines-5.png" width="672" />
@ -161,7 +204,7 @@ ggplot(dat, aes(x, y, group=group, color=factor(group))) +
geom_point(color="black") +
geom_smooth(se=FALSE, linetype="dashed", size=0.5) +
geom_xspline(spline_shape=1, size=0.5)
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
```
<img src="README_figs/README-splines-6.png" width="672" />
@ -172,7 +215,7 @@ ggplot(dat, aes(x, y, group=group, color=factor(group))) +
geom_point(color="black") +
geom_smooth(se=FALSE, linetype="dashed", size=0.5) +
geom_xspline(spline_shape=0, size=0.5)
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
```
<img src="README_figs/README-splines-7.png" width="672" />
@ -183,7 +226,7 @@ ggplot(dat, aes(x, y, group=group, color=factor(group))) +
geom_point(color="black") +
geom_smooth(se=FALSE, linetype="dashed", size=0.5) +
geom_xspline(spline_shape=-1, size=0.5)
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
```
<img src="README_figs/README-splines-8.png" width="672" />
@ -304,7 +347,7 @@ m + stat_bkde2d(bandwidth=c(0.5, 4), aes(fill = ..level..), geom = "polygon")
<img src="README_figs/README-bkde2d-2.png" width="672" />
### `coord_proj` LIVES! (still needs a teensy bit of work)
### `coord_proj` LIVES\! (still needs a teensy bit of work)
``` r
world <- map_data("world")
@ -584,6 +627,21 @@ p1 + annotation_ticks(sides = 'lb', scale = c('identity','log10'))
<img src="README_figs/README-annoticks-3.png" width="672" />
``` r
mtcars$name <- rownames(mtcars)
p <- ggplot(data = mtcars, aes(x=mpg,y=disp)) + geom_point()
p +
geom_spikelines(data = mtcars[mtcars$carb==4,],aes(colour = factor(gear)), linetype = 2) +
ggrepel::geom_label_repel(data = mtcars[mtcars$carb==4,],aes(label = name))
```
<img src="README_figs/README-spikelines-1.png" width="672" />
### Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of
Conduct](CONDUCT.md). By participating in this project you agree to
abide by its terms.

BIN
README_figs/README-annoticks-1.png View File

Before After
Width: 1344  |  Height: 480  |  Size: 32 KiB Width: 1344  |  Height: 480  |  Size: 32 KiB

BIN
README_figs/README-annoticks-2.png View File

Before After
Width: 1344  |  Height: 480  |  Size: 33 KiB Width: 1344  |  Height: 480  |  Size: 33 KiB

BIN
README_figs/README-annoticks-3.png View File

Before After
Width: 1344  |  Height: 480  |  Size: 39 KiB Width: 1344  |  Height: 480  |  Size: 40 KiB

BIN
README_figs/README-bkde2d-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 235 KiB Width: 1344  |  Height: 960  |  Size: 235 KiB

BIN
README_figs/README-bkde2d-2.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 111 KiB Width: 1344  |  Height: 960  |  Size: 112 KiB

BIN
README_figs/README-bkde_ash-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 63 KiB Width: 1344  |  Height: 960  |  Size: 63 KiB

BIN
README_figs/README-bkde_ash-2.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 63 KiB Width: 1344  |  Height: 960  |  Size: 63 KiB

BIN
README_figs/README-bkde_ash-3.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 63 KiB Width: 1344  |  Height: 960  |  Size: 63 KiB

BIN
README_figs/README-bkde_ash-4.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 63 KiB Width: 1344  |  Height: 960  |  Size: 63 KiB

BIN
README_figs/README-bkde_ash-5.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 101 KiB Width: 1344  |  Height: 960  |  Size: 102 KiB

BIN
README_figs/README-bkde_ash-6.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 72 KiB Width: 1344  |  Height: 960  |  Size: 73 KiB

BIN
README_figs/README-bkde_ash-7.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 89 KiB Width: 1344  |  Height: 960  |  Size: 88 KiB

BIN
README_figs/README-bkde_ash-8.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 84 KiB Width: 1344  |  Height: 960  |  Size: 84 KiB

BIN
README_figs/README-coord_proj-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 183 KiB Width: 1344  |  Height: 960  |  Size: 184 KiB

BIN
README_figs/README-dumbbell-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 120 KiB Width: 1344  |  Height: 960  |  Size: 120 KiB

BIN
README_figs/README-dumbbell2-1.png View File

Before After
Width: 1344  |  Height: 480  |  Size: 35 KiB Width: 1344  |  Height: 480  |  Size: 36 KiB

BIN
README_figs/README-encircle-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 49 KiB Width: 1344  |  Height: 960  |  Size: 49 KiB

BIN
README_figs/README-encircle-2.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 59 KiB Width: 1344  |  Height: 960  |  Size: 59 KiB

BIN
README_figs/README-encircle-3.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 62 KiB Width: 1344  |  Height: 960  |  Size: 62 KiB

BIN
README_figs/README-encircle-4.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 54 KiB Width: 1344  |  Height: 960  |  Size: 54 KiB

BIN
README_figs/README-encircle-5.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 48 KiB Width: 1344  |  Height: 960  |  Size: 48 KiB

BIN
README_figs/README-encircle-6.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 83 KiB Width: 1344  |  Height: 960  |  Size: 84 KiB

BIN
README_figs/README-encircle-7.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 84 KiB Width: 1344  |  Height: 960  |  Size: 84 KiB

BIN
README_figs/README-horizon-1.png View File

Before After
Width: 1824  |  Height: 1824  |  Size: 798 KiB Width: 1824  |  Height: 1824  |  Size: 795 KiB

BIN
README_figs/README-lollipop-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 145 KiB Width: 1344  |  Height: 960  |  Size: 147 KiB

BIN
README_figs/README-spikelines-1.png View File

Before After
Width: 1344  |  Height: 1344  |  Size: 135 KiB

BIN
README_figs/README-splines-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 110 KiB Width: 1344  |  Height: 960  |  Size: 108 KiB

BIN
README_figs/README-splines-2.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 132 KiB Width: 1344  |  Height: 960  |  Size: 134 KiB

BIN
README_figs/README-splines-3.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 138 KiB Width: 1344  |  Height: 960  |  Size: 138 KiB

BIN
README_figs/README-splines-4.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 137 KiB Width: 1344  |  Height: 960  |  Size: 137 KiB

BIN
README_figs/README-splines-5.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 133 KiB Width: 1344  |  Height: 960  |  Size: 134 KiB

BIN
README_figs/README-splines-6.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 131 KiB Width: 1344  |  Height: 960  |  Size: 131 KiB

BIN
README_figs/README-splines-7.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 136 KiB Width: 1344  |  Height: 960  |  Size: 137 KiB

BIN
README_figs/README-splines-8.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 138 KiB Width: 1344  |  Height: 960  |  Size: 138 KiB

BIN
README_figs/README-stateface-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 112 KiB Width: 1344  |  Height: 960  |  Size: 112 KiB

BIN
README_figs/README-stepribbon-1.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 39 KiB Width: 1344  |  Height: 960  |  Size: 39 KiB

BIN
README_figs/README-stepribbon-2.png View File

Before After
Width: 1344  |  Height: 960  |  Size: 39 KiB Width: 1344  |  Height: 960  |  Size: 39 KiB

+ 3
- 3
man/annotation_ticks.Rd View File

@ -21,13 +21,13 @@ bottom, and left.}
using \code{scale_y_log10}. It should be \code{FALSE} when using
\code{coord_trans(y = "log10")}.}
\item{short}{a \code{\link[grid]{unit}} object specifying the length of the
\item{short}{a \code{\link[grid:unit]{grid::unit()}} object specifying the length of the
short tick marks}
\item{mid}{a \code{\link[grid]{unit}} object specifying the length of the
\item{mid}{a \code{\link[grid:unit]{grid::unit()}} object specifying the length of the
middle tick marks. In base 10, these are the "5" ticks.}
\item{long}{a \code{\link[grid]{unit}} object specifying the length of the
\item{long}{a \code{\link[grid:unit]{grid::unit()}} object specifying the length of the
long tick marks. In base 10, these are the "1" (or "10") ticks.}
\item{colour}{Colour of the tick marks.}


+ 16
- 14
man/geom_bkde.Rd View File

@ -15,24 +15,24 @@ stat_bkde(mapping = NULL, data = NULL, geom = "area",
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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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
a call to a position adjustment function.}
@ -50,14 +50,16 @@ a warning. If \code{TRUE}, missing values are silently removed.}
\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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
\item{...}{other arguments passed on to \code{\link{layer}}. These are
\item{...}{Other arguments passed on to \code{\link[=layer]{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.}


+ 19
- 19
man/geom_bkde2d.Rd View File

@ -16,24 +16,24 @@ stat_bkde2d(mapping = NULL, data = NULL, geom = "density2d",
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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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.}
@ -50,28 +50,30 @@ results. see \code{\link[KernSmooth]{bkde2D}} for details}
minimum and maximum values of x at which to compute the estimate for
each direction. see \code{\link[KernSmooth]{bkde2D}} for details}
\item{lineend}{Line end style (round, butt, square)}
\item{lineend}{Line end style (round, butt, square).}
\item{contour}{If \code{TRUE}, contour the results of the 2d density
estimation}
\item{linejoin}{Line join style (round, mitre, bevel)}
\item{linejoin}{Line join style (round, mitre, bevel).}
\item{linemitre}{Line mitre limit (number greater than 1)}
\item{linemitre}{Line mitre limit (number greater than 1).}
\item{na.rm}{If \code{FALSE}, the default, missing values are removed with
a warning. If \code{TRUE}, missing values are silently removed.}
\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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
\item{...}{other arguments passed on to \code{\link{layer}}. These are
\item{...}{Other arguments passed on to \code{\link[=layer]{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.}
@ -87,8 +89,6 @@ specified by range.x are ignored. see \code{\link[KernSmooth]{bkde2D}}
for details}
}
\description{
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
}


+ 16
- 14
man/geom_cartogram.Rd View File

@ -8,29 +8,29 @@ geom_cartogram(mapping = NULL, data = NULL, stat = "identity", ..., map,
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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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{...}{other arguments passed on to \code{\link{layer}}. These are
\item{...}{Other arguments passed on to \code{\link[=layer]{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.}
@ -45,12 +45,14 @@ a warning. If \code{TRUE}, missing values are silently removed.}
\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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
}
\description{
This replicates the old behaviour of \code{geom_map()}, enabling specifying of


+ 15
- 13
man/geom_dumbbell.Rd View File

@ -10,24 +10,24 @@ geom_dumbbell(mapping = NULL, data = NULL, ..., colour_x = NULL,
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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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{...}{other arguments passed on to \code{\link{layer}}. These are
often aesthetics, used to set an aesthetic to a fixed value, like
@ -51,12 +51,14 @@ 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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
}
\description{
The dumbbell geom is used to create dumbbell charts.


+ 1
- 3
man/geom_horizon.Rd View File

@ -7,7 +7,7 @@
\alias{stat_horizon}
\alias{StatHorizon}
\title{Plot a time series as a horizon plot}
\format{An object of class \code{GeomHorizon} (inherits from \code{GeomArea}, \code{GeomRibbon}, \code{Geom}, \code{ggproto}) of length 4.}
\format{An object of class \code{GeomHorizon} (inherits from \code{GeomArea}, \code{GeomRibbon}, \code{Geom}, \code{ggproto}, \code{gg}) of length 4.}
\usage{
geom_horizon(mapping = NULL, data = NULL, show.legend = TRUE,
inherit.aes = TRUE, na.rm = TRUE, bandwidth = NULL, ...)
@ -25,8 +25,6 @@ A horizon plot breaks the Y dimension down using colours. This is useful
when visualising y values spanning a vast range and / or trying to highlight
outliers without losing context of the rest of the data.\cr \cr Horizon
plots are best viewed in an apsect ratio of very low vertical length.
Transforms data for a horizon plot
}
\section{Aesthetics}{
\code{x}, \code{y}, \code{fill}. \code{fill} defaults to \code{..band..} which is


+ 15
- 13
man/geom_lollipop.Rd View File

@ -9,24 +9,24 @@ geom_lollipop(mapping = NULL, data = NULL, ..., horizontal = 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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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{...}{other arguments passed on to \code{\link{layer}}. These are
often aesthetics, used to set an aesthetic to a fixed value, like
@ -49,12 +49,14 @@ 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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
}
\description{
The lollipop geom is used to create lollipop charts.


+ 82
- 0
man/geom_spikelines.Rd View File

@ -0,0 +1,82 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geom_spikelines.R
\name{geom_spikelines}
\alias{geom_spikelines}
\title{Draw spikelines on a plot}
\usage{
geom_spikelines(mapping = NULL, data = NULL, stat = "identity",
position = "identity", ..., arrow = NULL, lineend = "butt",
linejoin = "round", na.rm = FALSE, show.legend = NA,
inherit.aes = TRUE)
}
\arguments{
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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]{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]{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]{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{arrow}{Arrow specification, as created by \code{\link[grid:arrow]{grid::arrow()}}.}
\item{lineend}{Line end style (round, butt, square).}
\item{linejoin}{Line join style (round, mitre, bevel).}
\item{na.rm}{If \code{FALSE}, the default, missing values are removed with
a warning. If \code{TRUE}, missing values are silently removed.}
\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.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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]{borders()}}.}
}
\description{
Segment reference lines that originate at an point
}
\examples{
mtcars$name <- rownames(mtcars)
p <- ggplot(data = mtcars, aes(x=mpg,y=disp)) + geom_point()
p + geom_spikelines(data = mtcars[mtcars$carb==4,],linetype = 2)
p + geom_spikelines(data = mtcars[mtcars$carb==4,],aes(colour = factor(gear)), linetype = 2)
\dontrun{
require(ggrepel)
p + geom_spikelines(data = mtcars[mtcars$carb==4,],aes(colour = factor(gear)), linetype = 2) +
ggrepel::geom_label_repel(data = mtcars[mtcars$carb==4,],aes(label = name))
}
}

+ 18
- 15
man/geom_stateface.Rd View File

@ -10,24 +10,24 @@ geom_stateface(mapping = NULL, data = NULL, stat = "identity",
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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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.}
@ -35,12 +35,12 @@ 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
\item{...}{Other arguments passed on to \code{\link[=layer]{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
\item{parse}{If \code{TRUE}, the labels will be parsed into expressions and
displayed as described in ?plotmath}
\item{nudge_x, nudge_y}{Horizontal and vertical adjustment to nudge l
@ -55,12 +55,14 @@ a warning. If \code{TRUE}, missing values are silently removed.}
\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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
}
\description{
The \code{label} parameter can be either a 2-letter state abbreviation
@ -114,3 +116,4 @@ gg
Other StateFace operations: \code{\link{load_stateface}},
\code{\link{show_stateface}}
}
\concept{StateFace operations}

+ 15
- 13
man/geom_ubar.Rd View File

@ -9,24 +9,24 @@ geom_ubar(mapping = NULL, data = NULL, stat = "identity",
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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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.}
@ -44,12 +44,14 @@ 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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
}
\description{
I've been using \code{geom_segment} more to make "bar" charts, setting


+ 17
- 14
man/geom_xspline.Rd View File

@ -16,24 +16,24 @@ stat_xspline(mapping = NULL, data = NULL, geom = "line",
rep_ends = 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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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
a call to a position adjustment function.}
@ -43,12 +43,14 @@ a warning. If \code{TRUE}, missing values are silently removed.}
\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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
\item{spline_shape}{A numeric vector of values between -1 and 1, which
control the shape of the spline relative to the control points.}
@ -60,7 +62,7 @@ closed shape.}
first and last control points should be replicated for drawing the
curve. Ignored for closed X-splines.}
\item{...}{other arguments passed on to \code{\link{layer}}. These are
\item{...}{Other arguments passed on to \code{\link[=layer]{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.}
@ -193,3 +195,4 @@ Blanc, C. and Schlick, C. (1995), "X-splines : A Spline Model
Other xspline implementations: \code{\link{geom_xspline2}}
}
\concept{xspline implementations}

+ 17
- 14
man/geom_xspline2.Rd View File

@ -10,24 +10,24 @@ geom_xspline2(mapping = NULL, data = NULL, stat = "identity",
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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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}{Use to override the default connection between
\code{geom_xspline} and \code{stat_xspline}.}
@ -40,14 +40,16 @@ a warning. If \code{TRUE}, missing values are silently removed.}
\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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
\item{...}{other arguments passed on to \code{\link{layer}}. These are
\item{...}{Other arguments passed on to \code{\link[=layer]{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.}
@ -65,3 +67,4 @@ Other xspline implementations: \code{\link{geom_xspline}}
\author{
Ben Bolker
}
\concept{xspline implementations}

+ 4
- 3
man/ggalt-ggproto.Rd View File

@ -1,8 +1,8 @@
% 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_dumbbell.R, R/geom_encircle.r, R/geom_lollipop.r,
% R/geom_xspline.r, R/geom_xspline2.r, R/geom_ubar.r, R/stat-stepribbon.r,
% R/stateface.r
% R/geom_bkde2d.r, R/geom_spikelines.R, R/geom_dumbbell.R, R/geom_encircle.r,
% R/geom_lollipop.r, R/geom_xspline.r, R/geom_xspline2.r, R/geom_ubar.r,
% R/stat-stepribbon.r, R/stateface.r
\docType{data}
\name{CoordProj}
\alias{CoordProj}
@ -11,6 +11,7 @@
\alias{StatBkde}
\alias{GeomBkde2d}
\alias{StatBkde2d}
\alias{GeomSpikelines}
\alias{GeomDumbbell}
\alias{GeomEncircle}
\alias{GeomLollipop}


+ 0
- 2
man/ggplot2-ggproto.Rd View File

@ -8,8 +8,6 @@
\description{
If you are creating a new geom, stat, position, or scale in another package,
you'll need to extend from ggplot2::Geom, ggplot2::Stat, ggplot2::Position, or ggplot2::Scale.
Geom Cartogram
}
\seealso{
\code{\link[ggplot2]{ggplot2-ggproto}}


+ 1
- 0
man/load_stateface.Rd View File

@ -14,3 +14,4 @@ et. al. devices.
Other StateFace operations: \code{\link{geom_stateface}},
\code{\link{show_stateface}}
}
\concept{StateFace operations}

+ 1
- 0
man/show_stateface.Rd View File

@ -15,3 +15,4 @@ the font on your system
Other StateFace operations: \code{\link{geom_stateface}},
\code{\link{load_stateface}}
}
\concept{StateFace operations}

+ 16
- 14
man/stat_ash.Rd View File

@ -9,24 +9,24 @@ stat_ash(mapping = NULL, data = NULL, geom = "area", position = "stack",
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
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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}
@ -50,14 +50,16 @@ a warning. If \code{TRUE}, missing values are silently removed.}
\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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
\item{...}{other arguments passed on to \code{\link{layer}}. These are
\item{...}{Other arguments passed on to \code{\link[=layer]{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.}


+ 16
- 14
man/stat_stepribbon.Rd View File

@ -9,24 +9,24 @@ stat_stepribbon(mapping = NULL, data = NULL, geom = "ribbon",
inherit.aes = TRUE, direction = "hv", ...)
}
\arguments{
\item{mapping}{Set of aesthetic mappings created by \code{\link{aes}} or
\code{\link{aes_}}. If specified and \code{inherit.aes = TRUE} (the
\item{mapping}{Set of aesthetic mappings created by \code{\link[=aes]{aes()}} or
\code{\link[=aes_]{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:
options:
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link{ggplot}}.
If \code{NULL}, the default, the data is inherited from the plot
data as specified in the call to \code{\link[=ggplot]{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{data.frame}, or other object, will override the plot
data. All objects will be fortified to produce a data frame. See
\code{\link[=fortify]{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.}
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}{which geom to use; defaults to "\code{ribbon}"}
@ -38,17 +38,19 @@ a warning. If \code{TRUE}, missing values are silently removed.}
\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.}
\code{FALSE} never includes, and \code{TRUE} always includes.
It can also be a named logical vector to finely select the aesthetics to
display.}
\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}}.}
the default plot specification, e.g. \code{\link[=borders]{borders()}}.}
\item{direction}{\code{hv} for horizontal-veritcal steps, `vh`` for
vertical-horizontal steps}
\item{...}{other arguments passed on to \code{\link{layer}}. These are
\item{...}{Other arguments passed on to \code{\link[=layer]{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.}


Loading…
Cancel
Save