Browse Source

add pkgdown

pull/54/head
Jonathan Sidi 5 years ago
parent
commit
5bdb6cf28f
  1. 2
      .Rbuildignore
  2. 25
      .travis.yml
  3. 7
      DESCRIPTION
  4. 1
      R/geom_ubar.r
  5. 451
      README.Rmd
  6. 645
      README.md
  7. BIN
      README_figs/README-bkde2d-1.png
  8. BIN
      README_figs/README-bkde2d-2.png
  9. BIN
      README_figs/README-bkde_ash-1.png
  10. BIN
      README_figs/README-bkde_ash-2.png
  11. BIN
      README_figs/README-bkde_ash-3.png
  12. BIN
      README_figs/README-bkde_ash-4.png
  13. BIN
      README_figs/README-bkde_ash-5.png
  14. BIN
      README_figs/README-bkde_ash-6.png
  15. BIN
      README_figs/README-bkde_ash-7.png
  16. BIN
      README_figs/README-bkde_ash-8.png
  17. BIN
      README_figs/README-coord_proj-1.png
  18. BIN
      README_figs/README-dumbbell-1.png
  19. BIN
      README_figs/README-encircle-1.png
  20. BIN
      README_figs/README-encircle-2.png
  21. BIN
      README_figs/README-encircle-3.png
  22. BIN
      README_figs/README-encircle-4.png
  23. BIN
      README_figs/README-encircle-5.png
  24. BIN
      README_figs/README-encircle-6.png
  25. BIN
      README_figs/README-encircle-7.png
  26. BIN
      README_figs/README-lollipop-1.png
  27. BIN
      README_figs/README-splines-1.png
  28. BIN
      README_figs/README-splines-2.png
  29. BIN
      README_figs/README-splines-3.png
  30. BIN
      README_figs/README-splines-4.png
  31. BIN
      README_figs/README-splines-5.png
  32. BIN
      README_figs/README-splines-6.png
  33. BIN
      README_figs/README-splines-7.png
  34. BIN
      README_figs/README-splines-8.png
  35. BIN
      README_figs/README-stateface-1.png
  36. BIN
      README_figs/README-stepribbon-1.png
  37. BIN
      README_figs/README-stepribbon-2.png
  38. 0
      _pkgdown.yml
  39. 185
      docs/CONDUCT.html
  40. 179
      docs/LICENSE-text.html
  41. 187
      docs/articles/annoticks.html
  42. BIN
      docs/articles/annoticks_files/figure-html/annoticks-1.png
  43. BIN
      docs/articles/annoticks_files/figure-html/annoticks-2.png
  44. BIN
      docs/articles/annoticks_files/figure-html/annoticks-3.png
  45. 245
      docs/articles/density.html
  46. BIN
      docs/articles/density_files/figure-html/bkde2d-1.png
  47. BIN
      docs/articles/density_files/figure-html/bkde2d-2.png
  48. BIN
      docs/articles/density_files/figure-html/bkde_ash-1.png
  49. BIN
      docs/articles/density_files/figure-html/bkde_ash-2.png
  50. BIN
      docs/articles/density_files/figure-html/bkde_ash-3.png
  51. BIN
      docs/articles/density_files/figure-html/bkde_ash-4.png
  52. BIN
      docs/articles/density_files/figure-html/bkde_ash-5.png
  53. BIN
      docs/articles/density_files/figure-html/bkde_ash-6.png
  54. BIN
      docs/articles/density_files/figure-html/unnamed-chunk-3-1.png
  55. BIN
      docs/articles/density_files/figure-html/unnamed-chunk-3-2.png
  56. 180
      docs/articles/dumbell.html
  57. BIN
      docs/articles/dumbell_files/figure-html/dumbbell2-1.png
  58. 217
      docs/articles/encircling.html
  59. BIN
      docs/articles/encircling_files/figure-html/encircle-1.png
  60. BIN
      docs/articles/encircling_files/figure-html/encircle-2.png
  61. BIN
      docs/articles/encircling_files/figure-html/encircle-3.png
  62. BIN
      docs/articles/encircling_files/figure-html/encircle-4.png
  63. BIN
      docs/articles/encircling_files/figure-html/encircle-5.png
  64. BIN
      docs/articles/encircling_files/figure-html/unnamed-chunk-3-1.png
  65. BIN
      docs/articles/encircling_files/figure-html/unnamed-chunk-3-2.png
  66. 421
      docs/articles/ggalt_examples.html
  67. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde2d-1.png
  68. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde2d-2.png
  69. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde_ash-1.png
  70. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde_ash-2.png
  71. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde_ash-3.png
  72. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde_ash-4.png
  73. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde_ash-5.png
  74. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde_ash-6.png
  75. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde_ash-7.png
  76. BIN
      docs/articles/ggalt_examples_files/figure-html/bkde_ash-8.png
  77. BIN
      docs/articles/ggalt_examples_files/figure-html/dumbbell2-1.png
  78. BIN
      docs/articles/ggalt_examples_files/figure-html/dumbbellv-1.png
  79. BIN
      docs/articles/ggalt_examples_files/figure-html/encircle-1.png
  80. BIN
      docs/articles/ggalt_examples_files/figure-html/encircle-2.png
  81. BIN
      docs/articles/ggalt_examples_files/figure-html/encircle-3.png
  82. BIN
      docs/articles/ggalt_examples_files/figure-html/encircle-4.png
  83. BIN
      docs/articles/ggalt_examples_files/figure-html/encircle-5.png
  84. BIN
      docs/articles/ggalt_examples_files/figure-html/encircle-6.png
  85. BIN
      docs/articles/ggalt_examples_files/figure-html/encircle-7.png
  86. BIN
      docs/articles/ggalt_examples_files/figure-html/lollipop-1.png
  87. BIN
      docs/articles/ggalt_examples_files/figure-html/splines-1.png
  88. BIN
      docs/articles/ggalt_examples_files/figure-html/splines-2.png
  89. BIN
      docs/articles/ggalt_examples_files/figure-html/splines-3.png
  90. BIN
      docs/articles/ggalt_examples_files/figure-html/splines-4.png
  91. BIN
      docs/articles/ggalt_examples_files/figure-html/splines-5.png
  92. BIN
      docs/articles/ggalt_examples_files/figure-html/splines-6.png
  93. BIN
      docs/articles/ggalt_examples_files/figure-html/splines-7.png
  94. BIN
      docs/articles/ggalt_examples_files/figure-html/splines-8.png
  95. BIN
      docs/articles/ggalt_examples_files/figure-html/stateface-1.png
  96. BIN
      docs/articles/ggalt_examples_files/figure-html/stepribbon-1.png
  97. BIN
      docs/articles/ggalt_examples_files/figure-html/stepribbon-2.png
  98. 207
      docs/articles/horizon.html
  99. BIN
      docs/articles/horizon_files/figure-html/unnamed-chunk-3-1.png
  100. 193
      docs/articles/index.html

2
.Rbuildignore

@ -1,3 +1,5 @@
^docs$
^_pkgdown\.yml$
^.*\.Rproj$
^\.Rproj\.user$
^README.*$

25
.travis.yml

@ -1,19 +1,26 @@
language: r
warnings_are_errors: true
sudo: required
cache: packages
apt_packages:
- binutils
- libproj-dev
- gdal-bin
- binutils
- libproj-dev
- gdal-bin
env:
global:
- CRAN: http://cran.rstudio.com
global:
- CRAN: http://cran.rstudio.com
- secure: MTi58h4im/sM7aAMBHUCq7DCPLHNJdZ+1Gv8GDl3DQoUSuR0fcWhNlYBHczFPakRqkM8fWho57Da3qY48eJav20hxpGZmrvV1rfuYDoSqqcxdkn8pqFBifv+UDCfoiftFC7dpDrnsGOAex5v4UO8cu0ttCbDd90mY97h5E4hZIguoFvhdLAjvjF2urNEqRsDEHVpYtFmg6nkm1anaVE7aTWxf7po4r4+lBHgHLGXU9F3SvrO5crccU18hW1sNuGevXmTbccSgASARFV1YNGwr4PeFZKRQVjBzOEUjXonJ9pccTcDRC6bBxxjTDIc1gzFxbWcCWwg2P7tdkiVyEL8BDR4oYcjdKsUl0mbD4Ke9BZ7sh8h5ZuJT0Ll7VmCdS3UYptksU0nlf2S+uqETsCpZr0tVge4EzM9gpOAqoPij1+wjdITf55OXsZkd9bDv4v3eazmrgxBpbz2qcGO3C8yO7BrSHWuuam3SByprGJlW+Z7DRuDYgZDtEZpjQ2rQSxsurUF2qBR75/2HLBNu4XFf4RseSf88iU8EpL1hDQaP2gw11c2iYLs9rX/BIEcKf20UVNhnxUOv025F2FBA6Wcjw2WMs+Y3uoo4Dpn2fSEtzapK+RcRrq7qmQh/QOMaql8yBqyRGyRCDCNdK/N//ObCr0JTxpGbyH7jMuZvOlaZTo=
notifications:
email:
on_success: change
on_failure: change
after_success:
- Rscript -e 'pkgdown::build_site()'
deploy:
provider: pages
skip-cleanup: true
github-token: "$GITHUB_PAT"
keep-history: true
local-dir: docs
on:
branch: master

7
DESCRIPTION

@ -38,7 +38,12 @@ Suggests:
knitr,
rmarkdown,
ggthemes,
reshape2
reshape2,
pkgdown,
hrbrthemes,
readr,
ggrepel,
viridis
Imports:
utils,
graphics,

1
R/geom_ubar.r

@ -26,6 +26,7 @@
#' to the paired geom/stat.
#' @inheritParams ggplot2::layer
#' @export
#' @rdname geom_ubar
#' @examples
#' library(ggplot2)
#'

451
README.Rmd

@ -1,47 +1,29 @@
---
output: rmarkdown::github_document
output: github_document
always_allow_html: yes
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(collapse=TRUE, comment="##", fig.retina=2, fig.path = "README_figs/README-")
knitr::opts_chunk$set(
collapse = TRUE,
comment = "##",
fig.retina = 2
)
```
[![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)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/hrbrmstr/ggalt?branch=master&svg=true)](https://ci.appveyor.com/project/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)
[![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)](https://CRAN.R-project.org/package=ggalt)
`ggalt` : Extra Coordinate Systems, Geoms, Statistical Transformations, Scales & Fonts for 'ggplot2'
# `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'.
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
- `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
- `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
## Installation
```{r eval=FALSE}
# you'll want to see the vignettes, trust me
@ -50,393 +32,30 @@ install.packages("ggalt")
# OR: devtools::install_github("hrbrmstr/ggalt")
```
```{r echo=FALSE, message=FALSE, warning=FALSE, error=FALSE}
options(width=120)
```
### Usage
```{r}
library(ggplot2)
library(gridExtra)
library(ggalt)
# current verison
packageVersion("ggalt")
set.seed(1492)
dat <- data.frame(x=c(1:10, 1:10, 1:10),
y=c(sample(15:30, 10), 2*sample(15:30, 10), 3*sample(15:30, 10)),
group=factor(c(rep(1, 10), rep(2, 10), rep(3, 10)))
)
```
### Horzon Chart
Example carved from: <https://github.com/halhen/viz-pub/blob/master/sports-time-of-day/2_gen_chart.R>
```{r horizon, message=FALSE, warning=FALSE, fig.height=9.5, fig.width=9.5}
library(hrbrthemes)
library(ggalt)
library(tidyverse)
sports <- read_tsv("https://github.com/halhen/viz-pub/raw/master/sports-time-of-day/activity.tsv")
sports %>%
group_by(activity) %>%
filter(max(p) > 3e-04,
!grepl('n\\.e\\.c', activity)) %>%
arrange(time) %>%
mutate(p_peak = p / max(p),
p_smooth = (lag(p_peak) + p_peak + lead(p_peak)) / 3,
p_smooth = coalesce(p_smooth, p_peak)) %>%
ungroup() %>%
do({
rbind(.,
filter(., time == 0) %>%
mutate(time = 24*60))
}) %>%
mutate(time = ifelse(time < 3 * 60, time + 24 * 60, time)) %>%
mutate(activity = reorder(activity, p_peak, FUN=which.max)) %>%
arrange(activity) %>%
mutate(activity.f = reorder(as.character(activity), desc(activity))) -> sports
sports <- mutate(sports, time2 = time/60)
ggplot(sports, aes(time2, p_smooth)) +
geom_horizon(bandwidth=0.1) +
facet_grid(activity.f~.) +
scale_x_continuous(expand=c(0,0), breaks=seq(from = 3, to = 27, by = 3), labels = function(x) {sprintf("%02d:00", as.integer(x %% 24))}) +
viridis::scale_fill_viridis(name = "Activity relative to peak", discrete=TRUE,
labels=scales::percent(seq(0, 1, 0.1)+0.1)) +
labs(x=NULL, y=NULL, title="Peak time of day for sports and leisure",
subtitle="Number of participants throughout the day compared to peak popularity.\nNote the morning-and-evening everyday workouts, the midday hobbies,\nand the evenings/late nights out.") +
theme_ipsum_rc(grid="") +
theme(panel.spacing.y=unit(-0.05, "lines")) +
theme(strip.text.y = element_text(hjust=0, angle=360)) +
theme(axis.text.y=element_blank())
```
### Splines!
```{r splines}
ggplot(dat, aes(x, y, group=group, color=group)) +
geom_point() +
geom_line()
ggplot(dat, aes(x, y, group=group, color=factor(group))) +
geom_point() +
geom_line() +
geom_smooth(se=FALSE, linetype="dashed", size=0.5)
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)
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)
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)
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)
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)
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)
```
#### Alternate (better) density plots
```{r bkde_ash}
# bkde
data(geyser, package="MASS")
ggplot(geyser, aes(x=duration)) +
stat_bkde(alpha=1/2)
ggplot(geyser, aes(x=duration)) +
geom_bkde(alpha=1/2)
ggplot(geyser, aes(x=duration)) +
stat_bkde(bandwidth=0.25)
ggplot(geyser, aes(x=duration)) +
geom_bkde(bandwidth=0.25)
set.seed(1492)
dat <- data.frame(cond = factor(rep(c("A","B"), each=200)),
rating = c(rnorm(200),rnorm(200, mean=.8)))
ggplot(dat, aes(x=rating, color=cond)) + geom_bkde(fill="#00000000")
ggplot(dat, aes(x=rating, fill=cond)) + geom_bkde(alpha=0.3)
# ash
set.seed(1492)
dat <- data.frame(x=rnorm(100))
grid.arrange(ggplot(dat, aes(x)) + stat_ash(),
ggplot(dat, aes(x)) + stat_bkde(),
ggplot(dat, aes(x)) + stat_density(),
nrow=3)
cols <- RColorBrewer::brewer.pal(3, "Dark2")
ggplot(dat, aes(x)) +
stat_ash(alpha=1/3, fill=cols[3]) +
stat_bkde(alpha=1/3, fill=cols[2]) +
stat_density(alpha=1/3, fill=cols[1]) +
geom_rug() +
labs(x=NULL, y="density/estimate") +
scale_x_continuous(expand=c(0,0)) +
theme_bw() +
theme(panel.grid=element_blank()) +
theme(panel.border=element_blank())
```
### Alternate 2D density plots
```{r bkde2d}
m <- ggplot(faithful, aes(x = eruptions, y = waiting)) +
geom_point() +
xlim(0.5, 6) +
ylim(40, 110)
m + geom_bkde2d(bandwidth=c(0.5, 4))
m + stat_bkde2d(bandwidth=c(0.5, 4), aes(fill = ..level..), geom = "polygon")
```
### `coord_proj` LIVES! (still needs a teensy bit of work)
```{r coord_proj}
world <- map_data("world")
world <- world[world$region != "Antarctica",]
gg <- ggplot()
gg <- gg + geom_cartogram(data=world, map=world,
aes(x=long, y=lat, map_id=region))
gg <- gg + coord_proj("+proj=wintri")
gg
```
### ProPublica StateFace
```{r stateface}
# Run show_stateface() to see the location of the TTF StateFace font
# You need to install it for it to work
set.seed(1492)
dat <- data.frame(state=state.abb,
x=sample(100, 50),
y=sample(100, 50),
col=sample(c("#b2182b", "#2166ac"), 50, replace=TRUE),
sz=sample(6:15, 50, replace=TRUE),
stringsAsFactors=FALSE)
gg <- ggplot(dat, aes(x=x, y=y))
gg <- gg + geom_stateface(aes(label=state, color=col, size=sz))
gg <- gg + scale_color_identity()
gg <- gg + scale_size_identity()
gg
```
### Encircling points automagically
```{r encircle}
d <- data.frame(x=c(1,1,2),y=c(1,2,2)*100)
gg <- ggplot(d,aes(x,y))
gg <- gg + scale_x_continuous(expand=c(0.5,1))
gg <- gg + scale_y_continuous(expand=c(0.5,1))
gg + geom_encircle(s_shape=1, expand=0) + geom_point()
gg + geom_encircle(s_shape=1, expand=0.1, colour="red") + geom_point()
gg + geom_encircle(s_shape=0.5, expand=0.1, colour="purple") + geom_point()
gg + geom_encircle(data=subset(d, x==1), colour="blue", spread=0.02) +
geom_point()
gg +geom_encircle(data=subset(d, x==2), colour="cyan", spread=0.04) +
geom_point()
gg <- ggplot(mpg, aes(displ, hwy))
gg + geom_encircle(data=subset(mpg, hwy>40)) + geom_point()
ss <- subset(mpg,hwy>31 & displ<2)
gg + geom_encircle(data=ss, colour="blue", s_shape=0.9, expand=0.07) +
geom_point() + geom_point(data=ss, colour="blue")
```
### Step ribbons
```{r stepribbon}
x <- 1:10
df <- data.frame(x=x, y=x+10, ymin=x+7, ymax=x+12)
gg <- ggplot(df, aes(x, y))
gg <- gg + geom_ribbon(aes(ymin=ymin, ymax=ymax),
stat="stepribbon", fill="#b2b2b2")
gg <- gg + geom_step(color="#2b2b2b")
gg
gg <- ggplot(df, aes(x, y))
gg <- gg + geom_ribbon(aes(ymin=ymin, ymax=ymax),
stat="stepribbon", fill="#b2b2b2",
direction="vh")
gg <- gg + geom_step(color="#2b2b2b")
gg
```
### Lollipop charts
```{r lollipop}
df <- read.csv(text="category,pct
Other,0.09
South Asian/South Asian Americans,0.12
Interngenerational/Generational,0.21
S Asian/Asian Americans,0.25
Muslim Observance,0.29
Africa/Pan Africa/African Americans,0.34
Gender Equity,0.34
Disability Advocacy,0.49
European/European Americans,0.52
Veteran,0.54
Pacific Islander/Pacific Islander Americans,0.59
Non-Traditional Students,0.61
Religious Equity,0.64
Caribbean/Caribbean Americans,0.67
Latino/Latina,0.69
Middle Eastern Heritages and Traditions,0.73
Trans-racial Adoptee/Parent,0.76
LBGTQ/Ally,0.79
Mixed Race,0.80
Jewish Heritage/Observance,0.85
International Students,0.87", stringsAsFactors=FALSE, sep=",", header=TRUE)
library(ggplot2)
library(ggalt)
library(scales)
gg <- ggplot(df, aes(y=reorder(category, pct), x=pct))
gg <- gg + geom_lollipop(point.colour="steelblue", point.size=2, horizontal=TRUE)
gg <- gg + scale_x_continuous(expand=c(0,0), labels=percent,
breaks=seq(0, 1, by=0.2), limits=c(0, 1))
gg <- gg + labs(x=NULL, y=NULL,
title="SUNY Cortland Multicultural Alumni survey results",
subtitle="Ranked by race, ethnicity, home land and orientation\namong the top areas of concern",
caption="Data from http://stephanieevergreen.com/lollipop/")
gg <- gg + theme_minimal(base_family="Arial Narrow")
gg <- gg + theme(panel.grid.major.y=element_blank())
gg <- gg + theme(panel.grid.minor=element_blank())
gg <- gg + theme(axis.line.y=element_line(color="#2b2b2b", size=0.15))
gg <- gg + theme(axis.text.y=element_text(margin=margin(r=0, l=0)))
gg <- gg + theme(plot.margin=unit(rep(30, 4), "pt"))
gg <- gg + theme(plot.title=element_text(face="bold"))
gg <- gg + theme(plot.subtitle=element_text(margin=margin(b=10)))
gg <- gg + theme(plot.caption=element_text(size=8, margin=margin(t=10)))
gg
```
```{r dumbbell, message=FALSE}
library(dplyr)
library(tidyr)
library(scales)
library(ggplot2)
library(ggalt) # devtools::install_github("hrbrmstr/ggalt")
health <- read.csv("https://rud.is/dl/zhealth.csv", stringsAsFactors=FALSE,
header=FALSE, col.names=c("pct", "area_id"))
areas <- read.csv("https://rud.is/dl/zarea_trans.csv", stringsAsFactors=FALSE, header=TRUE)
health %>%
mutate(area_id=trunc(area_id)) %>%
arrange(area_id, pct) %>%
mutate(year=rep(c("2014", "2013"), 26),
pct=pct/100) %>%
left_join(areas, "area_id") %>%
mutate(area_name=factor(area_name, levels=unique(area_name))) -> health
setNames(bind_cols(filter(health, year==2014), filter(health, year==2013))[,c(4,1,5)],
c("area_name", "pct_2014", "pct_2013")) -> health
gg <- ggplot(health, aes(x=pct_2014, xend=pct_2013, y=area_name, group=area_name))
gg <- gg + geom_dumbbell(colour="#a3c4dc", size=1.5, colour_xend="#0e668b",
dot_guide=TRUE, dot_guide_size=0.15)
gg <- gg + scale_x_continuous(label=percent)
gg <- gg + labs(x=NULL, y=NULL)
gg <- gg + theme_bw()
gg <- gg + theme(plot.background=element_rect(fill="#f7f7f7"))
gg <- gg + theme(panel.background=element_rect(fill="#f7f7f7"))
gg <- gg + theme(panel.grid.minor=element_blank())
gg <- gg + theme(panel.grid.major.y=element_blank())
gg <- gg + theme(panel.grid.major.x=element_line())
gg <- gg + theme(axis.ticks=element_blank())
gg <- gg + theme(legend.position="top")
gg <- gg + theme(panel.border=element_blank())
gg
```
```{r dumbbell2, message=FALSE, fig.width=7, fig.height=2.5}
library(hrbrthemes)
df <- data.frame(trt=LETTERS[1:5], l=c(20, 40, 10, 30, 50), r=c(70, 50, 30, 60, 80))
ggplot(df, aes(y=trt, x=l, xend=r)) +
geom_dumbbell(size=3, color="#e3e2e1",
colour_x = "#5b8124", colour_xend = "#bad744",
dot_guide=TRUE, dot_guide_size=0.25) +
labs(x=NULL, y=NULL, title="ggplot2 geom_dumbbell with dot guide") +
theme_ipsum_rc(grid="X") +
theme(panel.grid.major.x=element_line(size=0.05))
```
```{r annoticks, message=FALSE, fig.width=7, fig.height=2.5}
p <- ggplot(msleep, aes(bodywt, brainwt)) + geom_point()
# add identity scale minor ticks on y axis
p + annotation_ticks(sides = 'l')
# add identity scale minor ticks on x,y axis
p + annotation_ticks(sides = 'lb')
# log10 scale
p1 <- p + scale_x_log10()
# add minor ticks on both scales
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))
```
## Geoms/Stats
| __Geom__ | __Description__ | __Uses__ |
|:--|:--|:--|
| `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 | `KernSmooth::bkde`
| `geom_stateface()`| Use ProPublica's StateFace font in ggplot2 plots |
| `geom_bkde2d()` | Contours from a 2d density estimate. | `KernSmooth::bkde2D`
| `stat_bkde()` | Display a smooth density estimate | `KernSmooth::bkde`
| `stat_bkde2d()` | Contours from a 2d density estimate. | `KernSmooth::bkde2D`
| `stat_ash()` | Compute and display a univariate averaged shifted histogram (polynomial kernel) | `ash::ash1`/`ash::bin1`
| `geom_encircle()`| Automatically enclose points in a polygon |
| `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. |
| `byte_format()`| helpers. e.g. turn `10000` into `10 Kb` |
__note__: plotly integration for a few of the ^^ geoms
### Code of Conduct

645
README.md

@ -9,69 +9,16 @@ Status](https://travis-ci.org/hrbrmstr/ggalt.svg?branch=master)](https://travis-
[![AppVeyor Build
Status](https://ci.appveyor.com/api/projects/status/github/hrbrmstr/ggalt?branch=master&svg=true)](https://ci.appveyor.com/project/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)
[![downloads](http://cranlogs.r-pkg.org/badges/grand-total/ggalt)](https://CRAN.R-project.org/package=ggalt)
`ggalt` : Extra Coordinate Systems, Geoms, Statistical Transformations,
Scales & Fonts for ‘ggplot2’
# `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’.
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
- `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
- `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
## Installation
``` r
# you'll want to see the vignettes, trust me
@ -80,568 +27,30 @@ install.packages("ggalt")
# OR: devtools::install_github("hrbrmstr/ggalt")
```
### Usage
``` r
library(ggplot2)
library(gridExtra)
library(ggalt)
# current verison
packageVersion("ggalt")
## [1] '0.6.1'
set.seed(1492)
dat <- data.frame(x=c(1:10, 1:10, 1:10),
y=c(sample(15:30, 10), 2*sample(15:30, 10), 3*sample(15:30, 10)),
group=factor(c(rep(1, 10), rep(2, 10), rep(3, 10)))
)
```
### Horzon Chart
Example carved from:
<https://github.com/halhen/viz-pub/blob/master/sports-time-of-day/2_gen_chart.R>
``` r
library(hrbrthemes)
library(ggalt)
library(tidyverse)
sports <- read_tsv("https://github.com/halhen/viz-pub/raw/master/sports-time-of-day/activity.tsv")
sports %>%
group_by(activity) %>%
filter(max(p) > 3e-04,
!grepl('n\\.e\\.c', activity)) %>%
arrange(time) %>%
mutate(p_peak = p / max(p),
p_smooth = (lag(p_peak) + p_peak + lead(p_peak)) / 3,
p_smooth = coalesce(p_smooth, p_peak)) %>%
ungroup() %>%
do({
rbind(.,
filter(., time == 0) %>%
mutate(time = 24*60))
}) %>%
mutate(time = ifelse(time < 3 * 60, time + 24 * 60, time)) %>%
mutate(activity = reorder(activity, p_peak, FUN=which.max)) %>%
arrange(activity) %>%
mutate(activity.f = reorder(as.character(activity), desc(activity))) -> sports
sports <- mutate(sports, time2 = time/60)
ggplot(sports, aes(time2, p_smooth)) +
geom_horizon(bandwidth=0.1) +
facet_grid(activity.f~.) +
scale_x_continuous(expand=c(0,0), breaks=seq(from = 3, to = 27, by = 3), labels = function(x) {sprintf("%02d:00", as.integer(x %% 24))}) +
viridis::scale_fill_viridis(name = "Activity relative to peak", discrete=TRUE,
labels=scales::percent(seq(0, 1, 0.1)+0.1)) +
labs(x=NULL, y=NULL, title="Peak time of day for sports and leisure",
subtitle="Number of participants throughout the day compared to peak popularity.\nNote the morning-and-evening everyday workouts, the midday hobbies,\nand the evenings/late nights out.") +
theme_ipsum_rc(grid="") +
theme(panel.spacing.y=unit(-0.05, "lines")) +
theme(strip.text.y = element_text(hjust=0, angle=360)) +
theme(axis.text.y=element_blank())
```
<img src="README_figs/README-horizon-1.png" width="912" />
### Splines\!
``` r
ggplot(dat, aes(x, y, group=group, color=group)) +
geom_point() +
geom_line()
```
<img src="README_figs/README-splines-1.png" width="672" />
``` r
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' and formula 'y ~ x'
```
<img src="README_figs/README-splines-2.png" width="672" />
``` r
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' and formula 'y ~ x'
```
<img src="README_figs/README-splines-3.png" width="672" />
``` r
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' and formula 'y ~ x'
```
<img src="README_figs/README-splines-4.png" width="672" />
``` r
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' and formula 'y ~ x'
```
<img src="README_figs/README-splines-5.png" width="672" />
``` r
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' and formula 'y ~ x'
```
<img src="README_figs/README-splines-6.png" width="672" />
``` r
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' and formula 'y ~ x'
```
<img src="README_figs/README-splines-7.png" width="672" />
``` r
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' and formula 'y ~ x'
```
<img src="README_figs/README-splines-8.png" width="672" />
#### Alternate (better) density plots
``` r
# bkde
data(geyser, package="MASS")
ggplot(geyser, aes(x=duration)) +
stat_bkde(alpha=1/2)
## Bandwidth not specified. Using '0.14', via KernSmooth::dpik.
```
<img src="README_figs/README-bkde_ash-1.png" width="672" />
``` r
ggplot(geyser, aes(x=duration)) +
geom_bkde(alpha=1/2)
## Bandwidth not specified. Using '0.14', via KernSmooth::dpik.
```
<img src="README_figs/README-bkde_ash-2.png" width="672" />
``` r
ggplot(geyser, aes(x=duration)) +
stat_bkde(bandwidth=0.25)
```
<img src="README_figs/README-bkde_ash-3.png" width="672" />
``` r
ggplot(geyser, aes(x=duration)) +
geom_bkde(bandwidth=0.25)
```
<img src="README_figs/README-bkde_ash-4.png" width="672" />
``` r
set.seed(1492)
dat <- data.frame(cond = factor(rep(c("A","B"), each=200)),
rating = c(rnorm(200),rnorm(200, mean=.8)))
ggplot(dat, aes(x=rating, color=cond)) + geom_bkde(fill="#00000000")
## Bandwidth not specified. Using '0.36', via KernSmooth::dpik.
## Bandwidth not specified. Using '0.31', via KernSmooth::dpik.
```
<img src="README_figs/README-bkde_ash-5.png" width="672" />
``` r
ggplot(dat, aes(x=rating, fill=cond)) + geom_bkde(alpha=0.3)
## Bandwidth not specified. Using '0.36', via KernSmooth::dpik.
## Bandwidth not specified. Using '0.31', via KernSmooth::dpik.
```
<img src="README_figs/README-bkde_ash-6.png" width="672" />
``` r
# ash
set.seed(1492)
dat <- data.frame(x=rnorm(100))
grid.arrange(ggplot(dat, aes(x)) + stat_ash(),
ggplot(dat, aes(x)) + stat_bkde(),
ggplot(dat, aes(x)) + stat_density(),
nrow=3)
## Estimate nonzero outside interval ab.
## Bandwidth not specified. Using '0.43', via KernSmooth::dpik.
```
<img src="README_figs/README-bkde_ash-7.png" width="672" />
``` r
cols <- RColorBrewer::brewer.pal(3, "Dark2")
ggplot(dat, aes(x)) +
stat_ash(alpha=1/3, fill=cols[3]) +
stat_bkde(alpha=1/3, fill=cols[2]) +
stat_density(alpha=1/3, fill=cols[1]) +
geom_rug() +
labs(x=NULL, y="density/estimate") +
scale_x_continuous(expand=c(0,0)) +
theme_bw() +
theme(panel.grid=element_blank()) +
theme(panel.border=element_blank())
## Estimate nonzero outside interval ab.
## Bandwidth not specified. Using '0.43', via KernSmooth::dpik.
```
<img src="README_figs/README-bkde_ash-8.png" width="672" />
### Alternate 2D density plots
``` r
m <- ggplot(faithful, aes(x = eruptions, y = waiting)) +
geom_point() +
xlim(0.5, 6) +
ylim(40, 110)
m + geom_bkde2d(bandwidth=c(0.5, 4))
```
<img src="README_figs/README-bkde2d-1.png" width="672" />
``` r
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)
``` r
world <- map_data("world")
##
## Attaching package: 'maps'
## The following object is masked from 'package:purrr':
##
## map
world <- world[world$region != "Antarctica",]
gg <- ggplot()
gg <- gg + geom_cartogram(data=world, map=world,
aes(x=long, y=lat, map_id=region))
gg <- gg + coord_proj("+proj=wintri")
gg
```
<img src="README_figs/README-coord_proj-1.png" width="672" />
### ProPublica StateFace
``` r
# Run show_stateface() to see the location of the TTF StateFace font
# You need to install it for it to work
set.seed(1492)
dat <- data.frame(state=state.abb,
x=sample(100, 50),
y=sample(100, 50),
col=sample(c("#b2182b", "#2166ac"), 50, replace=TRUE),
sz=sample(6:15, 50, replace=TRUE),
stringsAsFactors=FALSE)
gg <- ggplot(dat, aes(x=x, y=y))
gg <- gg + geom_stateface(aes(label=state, color=col, size=sz))
gg <- gg + scale_color_identity()
gg <- gg + scale_size_identity()
gg
```
<img src="README_figs/README-stateface-1.png" width="672" />
### Encircling points automagically
``` r
d <- data.frame(x=c(1,1,2),y=c(1,2,2)*100)
gg <- ggplot(d,aes(x,y))
gg <- gg + scale_x_continuous(expand=c(0.5,1))
gg <- gg + scale_y_continuous(expand=c(0.5,1))
gg + geom_encircle(s_shape=1, expand=0) + geom_point()
```
<img src="README_figs/README-encircle-1.png" width="672" />
``` r
gg + geom_encircle(s_shape=1, expand=0.1, colour="red") + geom_point()
```
<img src="README_figs/README-encircle-2.png" width="672" />
``` r
gg + geom_encircle(s_shape=0.5, expand=0.1, colour="purple") + geom_point()
```
<img src="README_figs/README-encircle-3.png" width="672" />
``` r
gg + geom_encircle(data=subset(d, x==1), colour="blue", spread=0.02) +
geom_point()
```
<img src="README_figs/README-encircle-4.png" width="672" />
``` r
gg +geom_encircle(data=subset(d, x==2), colour="cyan", spread=0.04) +
geom_point()
```
<img src="README_figs/README-encircle-5.png" width="672" />
``` r
gg <- ggplot(mpg, aes(displ, hwy))
gg + geom_encircle(data=subset(mpg, hwy>40)) + geom_point()
```
<img src="README_figs/README-encircle-6.png" width="672" />
``` r
ss <- subset(mpg,hwy>31 & displ<2)
gg + geom_encircle(data=ss, colour="blue", s_shape=0.9, expand=0.07) +
geom_point() + geom_point(data=ss, colour="blue")
```
<img src="README_figs/README-encircle-7.png" width="672" />
### Step ribbons
``` r
x <- 1:10
df <- data.frame(x=x, y=x+10, ymin=x+7, ymax=x+12)
gg <- ggplot(df, aes(x, y))
gg <- gg + geom_ribbon(aes(ymin=ymin, ymax=ymax),
stat="stepribbon", fill="#b2b2b2")
gg <- gg + geom_step(color="#2b2b2b")
gg
```
<img src="README_figs/README-stepribbon-1.png" width="672" />
``` r
gg <- ggplot(df, aes(x, y))
gg <- gg + geom_ribbon(aes(ymin=ymin, ymax=ymax),
stat="stepribbon", fill="#b2b2b2",
direction="vh")
gg <- gg + geom_step(color="#2b2b2b")
gg
```
<img src="README_figs/README-stepribbon-2.png" width="672" />
### Lollipop charts
``` r
df <- read.csv(text="category,pct
Other,0.09
South Asian/South Asian Americans,0.12
Interngenerational/Generational,0.21
S Asian/Asian Americans,0.25
Muslim Observance,0.29
Africa/Pan Africa/African Americans,0.34
Gender Equity,0.34
Disability Advocacy,0.49
European/European Americans,0.52
Veteran,0.54
Pacific Islander/Pacific Islander Americans,0.59
Non-Traditional Students,0.61
Religious Equity,0.64
Caribbean/Caribbean Americans,0.67
Latino/Latina,0.69
Middle Eastern Heritages and Traditions,0.73
Trans-racial Adoptee/Parent,0.76
LBGTQ/Ally,0.79
Mixed Race,0.80
Jewish Heritage/Observance,0.85
International Students,0.87", stringsAsFactors=FALSE, sep=",", header=TRUE)
library(ggplot2)
library(ggalt)
library(scales)
##
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
##
## discard
## The following object is masked from 'package:readr':
##
## col_factor
gg <- ggplot(df, aes(y=reorder(category, pct), x=pct))
gg <- gg + geom_lollipop(point.colour="steelblue", point.size=2, horizontal=TRUE)
gg <- gg + scale_x_continuous(expand=c(0,0), labels=percent,
breaks=seq(0, 1, by=0.2), limits=c(0, 1))
gg <- gg + labs(x=NULL, y=NULL,
title="SUNY Cortland Multicultural Alumni survey results",
subtitle="Ranked by race, ethnicity, home land and orientation\namong the top areas of concern",
caption="Data from http://stephanieevergreen.com/lollipop/")
gg <- gg + theme_minimal(base_family="Arial Narrow")
gg <- gg + theme(panel.grid.major.y=element_blank())
gg <- gg + theme(panel.grid.minor=element_blank())
gg <- gg + theme(axis.line.y=element_line(color="#2b2b2b", size=0.15))
gg <- gg + theme(axis.text.y=element_text(margin=margin(r=0, l=0)))
gg <- gg + theme(plot.margin=unit(rep(30, 4), "pt"))
gg <- gg + theme(plot.title=element_text(face="bold"))
gg <- gg + theme(plot.subtitle=element_text(margin=margin(b=10)))
gg <- gg + theme(plot.caption=element_text(size=8, margin=margin(t=10)))
gg
```
<img src="README_figs/README-lollipop-1.png" width="672" />
``` r
library(dplyr)
library(tidyr)
library(scales)
library(ggplot2)
library(ggalt) # devtools::install_github("hrbrmstr/ggalt")
health <- read.csv("https://rud.is/dl/zhealth.csv", stringsAsFactors=FALSE,
header=FALSE, col.names=c("pct", "area_id"))
areas <- read.csv("https://rud.is/dl/zarea_trans.csv", stringsAsFactors=FALSE, header=TRUE)
health %>%
mutate(area_id=trunc(area_id)) %>%
arrange(area_id, pct) %>%
mutate(year=rep(c("2014", "2013"), 26),
pct=pct/100) %>%
left_join(areas, "area_id") %>%
mutate(area_name=factor(area_name, levels=unique(area_name))) -> health
setNames(bind_cols(filter(health, year==2014), filter(health, year==2013))[,c(4,1,5)],
c("area_name", "pct_2014", "pct_2013")) -> health
gg <- ggplot(health, aes(x=pct_2014, xend=pct_2013, y=area_name, group=area_name))
gg <- gg + geom_dumbbell(colour="#a3c4dc", size=1.5, colour_xend="#0e668b",
dot_guide=TRUE, dot_guide_size=0.15)
gg <- gg + scale_x_continuous(label=percent)
gg <- gg + labs(x=NULL, y=NULL)
gg <- gg + theme_bw()
gg <- gg + theme(plot.background=element_rect(fill="#f7f7f7"))
gg <- gg + theme(panel.background=element_rect(fill="#f7f7f7"))
gg <- gg + theme(panel.grid.minor=element_blank())
gg <- gg + theme(panel.grid.major.y=element_blank())
gg <- gg + theme(panel.grid.major.x=element_line())
gg <- gg + theme(axis.ticks=element_blank())
gg <- gg + theme(legend.position="top")
gg <- gg + theme(panel.border=element_blank())
gg
```
<img src="README_figs/README-dumbbell-1.png" width="672" />
``` r
library(hrbrthemes)
df <- data.frame(trt=LETTERS[1:5], l=c(20, 40, 10, 30, 50), r=c(70, 50, 30, 60, 80))
ggplot(df, aes(y=trt, x=l, xend=r)) +
geom_dumbbell(size=3, color="#e3e2e1",
colour_x = "#5b8124", colour_xend = "#bad744",
dot_guide=TRUE, dot_guide_size=0.25) +
labs(x=NULL, y=NULL, title="ggplot2 geom_dumbbell with dot guide") +
theme_ipsum_rc(grid="X") +
theme(panel.grid.major.x=element_line(size=0.05))
```
<img src="README_figs/README-dumbbell2-1.png" width="672" />
``` r
p <- ggplot(msleep, aes(bodywt, brainwt)) + geom_point()
# add identity scale minor ticks on y axis
p + annotation_ticks(sides = 'l')
## Warning: Removed 27 rows containing missing values (geom_point).
```
<img src="README_figs/README-annoticks-1.png" width="672" />
``` r
# add identity scale minor ticks on x,y axis
p + annotation_ticks(sides = 'lb')
## Warning: Removed 27 rows containing missing values (geom_point).
```
<img src="README_figs/README-annoticks-2.png" width="672" />
``` r
# log10 scale
p1 <- p + scale_x_log10()
# add minor ticks on both scales
p1 + annotation_ticks(sides = 'lb', scale = c('identity','log10'))
## Warning: Removed 27 rows containing missing values (geom_point).
```
<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" />
## Geoms/Stats
| **Geom** | **Description** | **Uses** |
| :------------------- | :-------------------------------------------------------------------------------------------------------------------------- | :---------------------- |
| `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 | `KernSmooth::bkde` |
| `geom_stateface()` | Use ProPublica’s StateFace font in ggplot2 plots | |
| `geom_bkde2d()` | Contours from a 2d density estimate. | `KernSmooth::bkde2D` |
| `stat_bkde()` | Display a smooth density estimate | `KernSmooth::bkde` |
| `stat_bkde2d()` | Contours from a 2d density estimate. | `KernSmooth::bkde2D` |
| `stat_ash()` | Compute and display a univariate averaged shifted histogram (polynomial kernel) | `ash::ash1`/`ash::bin1` |
| `geom_encircle()` | Automatically enclose points in a polygon | |
| `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. | |
| `byte_format()` | helpers. e.g. turn `10000` into `10 Kb` | |
**note**: plotly integration for a few of the ^^ geoms
### Code of Conduct

BIN
README_figs/README-bkde2d-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 KiB

After

Width:  |  Height:  |  Size: 225 KiB

BIN
README_figs/README-bkde2d-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 108 KiB

BIN
README_figs/README-bkde_ash-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 60 KiB

BIN
README_figs/README-bkde_ash-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 60 KiB

BIN
README_figs/README-bkde_ash-3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 61 KiB

BIN
README_figs/README-bkde_ash-4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 61 KiB

BIN
README_figs/README-bkde_ash-5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 99 KiB

BIN
README_figs/README-bkde_ash-6.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 70 KiB

BIN
README_figs/README-bkde_ash-7.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 85 KiB

BIN
README_figs/README-bkde_ash-8.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 81 KiB

BIN
README_figs/README-coord_proj-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 190 KiB

BIN
README_figs/README-dumbbell-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 118 KiB

BIN
README_figs/README-encircle-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 47 KiB

BIN
README_figs/README-encircle-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 55 KiB

BIN
README_figs/README-encircle-3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 59 KiB

BIN
README_figs/README-encircle-4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 51 KiB

BIN
README_figs/README-encircle-5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 46 KiB

BIN
README_figs/README-encircle-6.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 82 KiB

BIN
README_figs/README-encircle-7.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 82 KiB

BIN
README_figs/README-lollipop-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 146 KiB

BIN
README_figs/README-splines-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 106 KiB

BIN
README_figs/README-splines-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 130 KiB

BIN
README_figs/README-splines-3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 134 KiB

BIN
README_figs/README-splines-4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 135 KiB

BIN
README_figs/README-splines-5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 131 KiB

BIN
README_figs/README-splines-6.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 128 KiB

BIN
README_figs/README-splines-7.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 134 KiB

BIN
README_figs/README-splines-8.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 135 KiB

BIN
README_figs/README-stateface-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 110 KiB

BIN
README_figs/README-stepribbon-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
README_figs/README-stepribbon-2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

0
_pkgdown.yml

185
docs/CONDUCT.html

@ -0,0 +1,185 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contributor Code of Conduct • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script>
<meta property="og:title" content="Contributor Code of Conduct" />
<!-- mathjax -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-title-body">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/annoticks.html">Annotation Ticks</a>
</li>
<li>
<a href="articles/density.html">Density Plots</a>
</li>
<li>
<a href="articles/dumbell.html">Dumbbell Charts</a>
</li>
<li>
<a href="articles/encircling.html">Encircling Points</a>
</li>
<li>
<a href="articles/horizon.html">Horizon Plots</a>
</li>
<li>
<a href="articles/lollipop.html">Lollipop charts</a>
</li>
<li>
<a href="articles/proj.html">Coord Projection</a>
</li>
<li>
<a href="articles/spikelines.html">Spikelines</a>
</li>
<li>
<a href="articles/splines.html">Spline Plots</a>
</li>
<li>
<a href="articles/stateface.html">ProPublica StateFace</a>
</li>
<li>
<a href="articles/stepribbon.html">Step Ribbons</a>
</li>
<li>
<a href="articles/ubar.html">Uniform Bars</a>
</li>
<li>
<a href="articles/verticaldodge.html">Vertical Dodging</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>Contributor Code of Conduct</h1>
</div>
<div id="contributor-code-of-conduct" class="section level1">
<p>As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.</p>
<p>We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.</p>
<p>Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.</p>
<p>Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.</p>
<p>Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.</p>
<p>This Code of Conduct is adapted from the Contributor Covenant (<a href="http:contributor-covenant.org" class="uri">http:contributor-covenant.org</a>), version 1.0.0, available at <a href="http://contributor-covenant.org/version/1/0/0/" class="uri">http://contributor-covenant.org/version/1/0/0/</a></p>
</div>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

179
docs/LICENSE-text.html

@ -0,0 +1,179 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>License • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script>
<meta property="og:title" content="License" />
<!-- mathjax -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-title-body">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/annoticks.html">Annotation Ticks</a>
</li>
<li>
<a href="articles/density.html">Density Plots</a>
</li>
<li>
<a href="articles/dumbell.html">Dumbbell Charts</a>
</li>
<li>
<a href="articles/encircling.html">Encircling Points</a>
</li>
<li>
<a href="articles/horizon.html">Horizon Plots</a>
</li>
<li>
<a href="articles/lollipop.html">Lollipop charts</a>
</li>
<li>
<a href="articles/proj.html">Coord Projection</a>
</li>
<li>
<a href="articles/spikelines.html">Spikelines</a>
</li>
<li>
<a href="articles/splines.html">Spline Plots</a>
</li>
<li>
<a href="articles/stateface.html">ProPublica StateFace</a>
</li>
<li>
<a href="articles/stepribbon.html">Step Ribbons</a>
</li>
<li>
<a href="articles/ubar.html">Uniform Bars</a>
</li>
<li>
<a href="articles/verticaldodge.html">Vertical Dodging</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="contents col-md-9">
<div class="page-header">
<h1>License</h1>
</div>
<pre>YEAR: 2017
COPYRIGHT HOLDER: Bob Rudis
</pre>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

187
docs/articles/annoticks.html

@ -0,0 +1,187 @@
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Annotation Ticks • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Annotation Ticks">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/annoticks.html">Annotation Ticks</a>
</li>
<li>
<a href="../articles/density.html">Density Plots</a>
</li>
<li>
<a href="../articles/dumbell.html">Dumbbell Charts</a>
</li>
<li>
<a href="../articles/encircling.html">Encircling Points</a>
</li>
<li>
<a href="../articles/horizon.html">Horizon Plots</a>
</li>
<li>
<a href="../articles/lollipop.html">Lollipop charts</a>
</li>
<li>
<a href="../articles/proj.html">Coord Projection</a>
</li>
<li>
<a href="../articles/spikelines.html">Spikelines</a>
</li>
<li>
<a href="../articles/splines.html">Spline Plots</a>
</li>
<li>
<a href="../articles/stateface.html">ProPublica StateFace</a>
</li>
<li>
<a href="../articles/stepribbon.html">Step Ribbons</a>
</li>
<li>
<a href="../articles/ubar.html">Uniform Bars</a>
</li>
<li>
<a href="../articles/verticaldodge.html">Vertical Dodging</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Annotation Ticks</h1>
<h4 class="author">Jonathan Sidi</h4>
<h4 class="date">2019-02-22</h4>
<small class="dont-index">Source: <a href="https://github.com/hrbrmstr/ggalt/blob/master/vignettes/annoticks.Rmd"><code>vignettes/annoticks.Rmd</code></a></small>
<div class="hidden name"><code>annoticks.Rmd</code></div>
</div>
<div id="annotation-ticks" class="section level2">
<h2 class="hasAnchor">
<a href="#annotation-ticks" class="anchor"></a>Annotation Ticks</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"></a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw">library</span>(ggplot2)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw">library</span>(gridExtra)</a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="kw">library</span>(ggalt)</a>
<a class="sourceLine" id="cb1-5" data-line-number="5"><span class="kw">library</span>(scales)</a></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"></a>
<a class="sourceLine" id="cb2-2" data-line-number="2">p &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(msleep, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(bodywt, brainwt)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a>
<a class="sourceLine" id="cb2-3" data-line-number="3"></a>
<a class="sourceLine" id="cb2-4" data-line-number="4"><span class="co"># add identity scale minor ticks on y axis</span></a>
<a class="sourceLine" id="cb2-5" data-line-number="5">p <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/annotation_ticks.html">annotation_ticks</a></span>(<span class="dt">sides =</span> <span class="st">'l'</span>)</a></code></pre></div>
<p><img src="annoticks_files/figure-html/annoticks-1.png"><!-- --></p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"></a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="co"># add identity scale minor ticks on x,y axis</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3">p <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/annotation_ticks.html">annotation_ticks</a></span>(<span class="dt">sides =</span> <span class="st">'lb'</span>)</a></code></pre></div>
<p><img src="annoticks_files/figure-html/annoticks-2.png"><!-- --></p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="co"># log10 scale</span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3">p1 &lt;-<span class="st"> </span>p <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_x_log10</a></span>()</a>
<a class="sourceLine" id="cb4-4" data-line-number="4"></a>
<a class="sourceLine" id="cb4-5" data-line-number="5"><span class="co"># add minor ticks on both scales</span></a>
<a class="sourceLine" id="cb4-6" data-line-number="6">p1 <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/annotation_ticks.html">annotation_ticks</a></span>(<span class="dt">sides =</span> <span class="st">'lb'</span>, <span class="dt">scale =</span> <span class="kw">c</span>(<span class="st">'identity'</span>,<span class="st">'log10'</span>))</a></code></pre></div>
<p><img src="annoticks_files/figure-html/annoticks-3.png"><!-- --></p>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#annotation-ticks">Annotation Ticks</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

BIN
docs/articles/annoticks_files/figure-html/annoticks-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
docs/articles/annoticks_files/figure-html/annoticks-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/articles/annoticks_files/figure-html/annoticks-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

245
docs/articles/density.html

@ -0,0 +1,245 @@
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Density Plots • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Density Plots">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/annoticks.html">Annotation Ticks</a>
</li>
<li>
<a href="../articles/density.html">Density Plots</a>
</li>
<li>
<a href="../articles/dumbell.html">Dumbbell Charts</a>
</li>
<li>
<a href="../articles/encircling.html">Encircling Points</a>
</li>
<li>
<a href="../articles/horizon.html">Horizon Plots</a>
</li>
<li>
<a href="../articles/lollipop.html">Lollipop charts</a>
</li>
<li>
<a href="../articles/proj.html">Coord Projection</a>
</li>
<li>
<a href="../articles/spikelines.html">Spikelines</a>
</li>
<li>
<a href="../articles/splines.html">Spline Plots</a>
</li>
<li>
<a href="../articles/stateface.html">ProPublica StateFace</a>
</li>
<li>
<a href="../articles/stepribbon.html">Step Ribbons</a>
</li>
<li>
<a href="../articles/ubar.html">Uniform Bars</a>
</li>
<li>
<a href="../articles/verticaldodge.html">Vertical Dodging</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Density Plots</h1>
<h4 class="author">Bob Rudis</h4>
<h4 class="date">2019-02-22</h4>
<small class="dont-index">Source: <a href="https://github.com/hrbrmstr/ggalt/blob/master/vignettes/density.Rmd"><code>vignettes/density.Rmd</code></a></small>
<div class="hidden name"><code>density.Rmd</code></div>
</div>
<div id="alternate-better-density-plots" class="section level2">
<h2 class="hasAnchor">
<a href="#alternate-better-density-plots" class="anchor"></a>Alternate (better) density plots</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">library</span>(ggplot2)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw">library</span>(gridExtra)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw">library</span>(ggalt)</a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="kw">library</span>(scales)</a></code></pre></div>
<div id="bkde" class="section level3">
<h3 class="hasAnchor">
<a href="#bkde" class="anchor"></a>bkde</h3>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"></a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="kw">set.seed</span>(<span class="dv">1492</span>)</a>
<a class="sourceLine" id="cb2-3" data-line-number="3"></a>
<a class="sourceLine" id="cb2-4" data-line-number="4"><span class="kw">data</span>(geyser, <span class="dt">package=</span><span class="st">"MASS"</span>)</a>
<a class="sourceLine" id="cb2-5" data-line-number="5"></a>
<a class="sourceLine" id="cb2-6" data-line-number="6"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(geyser, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>duration)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">stat_bkde</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">2</span>)</a></code></pre></div>
<p><img src="density_files/figure-html/bkde_ash-1.png"><!-- --></p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"></a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(geyser, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>duration)) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">geom_bkde</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">2</span>)</a></code></pre></div>
<p><img src="density_files/figure-html/bkde_ash-2.png"><!-- --></p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(geyser, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>duration)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">stat_bkde</a></span>(<span class="dt">bandwidth=</span><span class="fl">0.25</span>)</a></code></pre></div>
<p><img src="density_files/figure-html/bkde_ash-3.png"><!-- --></p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"></a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(geyser, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>duration)) <span class="op">+</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">geom_bkde</a></span>(<span class="dt">bandwidth=</span><span class="fl">0.25</span>)</a></code></pre></div>
<p><img src="density_files/figure-html/bkde_ash-4.png"><!-- --></p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"></a>
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="kw">set.seed</span>(<span class="dv">1492</span>)</a>
<a class="sourceLine" id="cb6-3" data-line-number="3">dat &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">cond =</span> <span class="kw">factor</span>(<span class="kw">rep</span>(<span class="kw">c</span>(<span class="st">"A"</span>,<span class="st">"B"</span>), <span class="dt">each=</span><span class="dv">200</span>)), </a>
<a class="sourceLine" id="cb6-4" data-line-number="4"> <span class="dt">rating =</span> <span class="kw">c</span>(<span class="kw">rnorm</span>(<span class="dv">200</span>),<span class="kw">rnorm</span>(<span class="dv">200</span>, <span class="dt">mean=</span>.<span class="dv">8</span>)))</a>
<a class="sourceLine" id="cb6-5" data-line-number="5"></a>
<a class="sourceLine" id="cb6-6" data-line-number="6"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>rating, <span class="dt">color=</span>cond)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">geom_bkde</a></span>(<span class="dt">fill=</span><span class="st">"#00000000"</span>)</a></code></pre></div>
<p><img src="density_files/figure-html/bkde_ash-5.png"><!-- --></p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"></a>
<a class="sourceLine" id="cb7-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>rating, <span class="dt">fill=</span>cond)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">geom_bkde</a></span>(<span class="dt">alpha=</span><span class="fl">0.3</span>)</a></code></pre></div>
<p><img src="density_files/figure-html/bkde_ash-6.png"><!-- --></p>
</div>
<div id="ash" class="section level3">
<h3 class="hasAnchor">
<a href="#ash" class="anchor"></a>ash</h3>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"></a>
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="kw">set.seed</span>(<span class="dv">1492</span>)</a>
<a class="sourceLine" id="cb8-3" data-line-number="3"></a>
<a class="sourceLine" id="cb8-4" data-line-number="4">dat &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">x=</span><span class="kw">rnorm</span>(<span class="dv">100</span>))</a>
<a class="sourceLine" id="cb8-5" data-line-number="5"><span class="kw"><a href="http://www.rdocumentation.org/packages/gridExtra/topics/arrangeGrob">grid.arrange</a></span>(<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/stat_ash.html">stat_ash</a></span>(),</a>
<a class="sourceLine" id="cb8-6" data-line-number="6"> <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">stat_bkde</a></span>(),</a>
<a class="sourceLine" id="cb8-7" data-line-number="7"> <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_density.html">stat_density</a></span>(),</a>
<a class="sourceLine" id="cb8-8" data-line-number="8"> <span class="dt">nrow=</span><span class="dv">3</span>)</a></code></pre></div>
<p><img src="density_files/figure-html/unnamed-chunk-3-1.png"><!-- --></p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"></a>
<a class="sourceLine" id="cb9-2" data-line-number="2">cols &lt;-<span class="st"> </span>RColorBrewer<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/RColorBrewer/topics/ColorBrewer">brewer.pal</a></span>(<span class="dv">3</span>, <span class="st">"Dark2"</span>)</a>
<a class="sourceLine" id="cb9-3" data-line-number="3"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb9-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="../reference/stat_ash.html">stat_ash</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">3</span>, <span class="dt">fill=</span>cols[<span class="dv">3</span>]) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb9-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">stat_bkde</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">3</span>, <span class="dt">fill=</span>cols[<span class="dv">2</span>]) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb9-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_density.html">stat_density</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">3</span>, <span class="dt">fill=</span>cols[<span class="dv">1</span>]) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb9-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_rug.html">geom_rug</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb9-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/labs.html">labs</a></span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="st">"density/estimate"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb9-9" data-line-number="9"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_x_continuous</a></span>(<span class="dt">expand=</span><span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">0</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb9-10" data-line-number="10"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggtheme.html">theme_bw</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb9-11" data-line-number="11"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_blank</a></span>()) <span class="op">+</span></a>
<a class="sourceLine" id="cb9-12" data-line-number="12"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.border=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_blank</a></span>())</a></code></pre></div>
<p><img src="density_files/figure-html/unnamed-chunk-3-2.png"><!-- --></p>
</div>
</div>
<div id="d-density-plots" class="section level2">
<h2 class="hasAnchor">
<a href="#d-density-plots" class="anchor"></a>2D density plots</h2>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"></a>
<a class="sourceLine" id="cb10-2" data-line-number="2">m &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(faithful, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x =</span> eruptions, <span class="dt">y =</span> waiting)) <span class="op">+</span></a>
<a class="sourceLine" id="cb10-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb10-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/lims.html">xlim</a></span>(<span class="fl">0.5</span>, <span class="dv">6</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb10-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/lims.html">ylim</a></span>(<span class="dv">40</span>, <span class="dv">110</span>)</a>
<a class="sourceLine" id="cb10-6" data-line-number="6"></a>
<a class="sourceLine" id="cb10-7" data-line-number="7">m <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde2d.html">geom_bkde2d</a></span>(<span class="dt">bandwidth=</span><span class="kw">c</span>(<span class="fl">0.5</span>, <span class="dv">4</span>))</a></code></pre></div>
<p><img src="density_files/figure-html/bkde2d-1.png"><!-- --></p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"></a>
<a class="sourceLine" id="cb11-2" data-line-number="2">m <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde2d.html">stat_bkde2d</a></span>(<span class="dt">bandwidth=</span><span class="kw">c</span>(<span class="fl">0.5</span>, <span class="dv">4</span>), <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">fill =</span> ..level..), <span class="dt">geom =</span> <span class="st">"polygon"</span>)</a></code></pre></div>
<p><img src="density_files/figure-html/bkde2d-2.png"><!-- --></p>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#alternate-better-density-plots">Alternate (better) density plots</a></li>
<li><a href="#d-density-plots">2D density plots</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

BIN
docs/articles/density_files/figure-html/bkde2d-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
docs/articles/density_files/figure-html/bkde2d-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
docs/articles/density_files/figure-html/bkde_ash-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/density_files/figure-html/bkde_ash-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/density_files/figure-html/bkde_ash-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/density_files/figure-html/bkde_ash-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/density_files/figure-html/bkde_ash-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
docs/articles/density_files/figure-html/bkde_ash-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
docs/articles/density_files/figure-html/unnamed-chunk-3-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
docs/articles/density_files/figure-html/unnamed-chunk-3-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

180
docs/articles/dumbell.html

@ -0,0 +1,180 @@
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dumbbell Charts • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Dumbbell Charts">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/annoticks.html">Annotation Ticks</a>
</li>
<li>
<a href="../articles/density.html">Density Plots</a>
</li>
<li>
<a href="../articles/dumbell.html">Dumbbell Charts</a>
</li>
<li>
<a href="../articles/encircling.html">Encircling Points</a>
</li>
<li>
<a href="../articles/horizon.html">Horizon Plots</a>
</li>
<li>
<a href="../articles/lollipop.html">Lollipop charts</a>
</li>
<li>
<a href="../articles/proj.html">Coord Projection</a>
</li>
<li>
<a href="../articles/spikelines.html">Spikelines</a>
</li>
<li>
<a href="../articles/splines.html">Spline Plots</a>
</li>
<li>
<a href="../articles/stateface.html">ProPublica StateFace</a>
</li>
<li>
<a href="../articles/stepribbon.html">Step Ribbons</a>
</li>
<li>
<a href="../articles/ubar.html">Uniform Bars</a>
</li>
<li>
<a href="../articles/verticaldodge.html">Vertical Dodging</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Dumbbell Charts</h1>
<h4 class="author">Bob Rudis</h4>
<h4 class="date">2019-02-22</h4>
<small class="dont-index">Source: <a href="https://github.com/hrbrmstr/ggalt/blob/master/vignettes/dumbell.Rmd"><code>vignettes/dumbell.Rmd</code></a></small>
<div class="hidden name"><code>dumbell.Rmd</code></div>
</div>
<div id="dumbbell-charts" class="section level2">
<h2 class="hasAnchor">
<a href="#dumbbell-charts" class="anchor"></a>Dumbbell Charts</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">library</span>(ggplot2)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw">library</span>(gridExtra)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw">library</span>(ggalt)</a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="kw">library</span>(scales)</a></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1">df &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">trt=</span>LETTERS[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>], <span class="dt">l=</span><span class="kw">c</span>(<span class="dv">20</span>, <span class="dv">40</span>, <span class="dv">10</span>, <span class="dv">30</span>, <span class="dv">50</span>), <span class="dt">r=</span><span class="kw">c</span>(<span class="dv">70</span>, <span class="dv">50</span>, <span class="dv">30</span>, <span class="dv">60</span>, <span class="dv">80</span>))</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"></a>
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(df, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">y=</span>trt, <span class="dt">x=</span>l, <span class="dt">xend=</span>r)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="../reference/geom_dumbbell.html">geom_dumbbell</a></span>(<span class="dt">size=</span><span class="dv">3</span>, <span class="dt">color=</span><span class="st">"#e3e2e1"</span>, </a>
<a class="sourceLine" id="cb2-5" data-line-number="5"> <span class="dt">colour_x =</span> <span class="st">"#5b8124"</span>, <span class="dt">colour_xend =</span> <span class="st">"#bad744"</span>,</a>
<a class="sourceLine" id="cb2-6" data-line-number="6"> <span class="dt">dot_guide=</span><span class="ot">TRUE</span>, <span class="dt">dot_guide_size=</span><span class="fl">0.25</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb2-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/labs.html">labs</a></span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="ot">NULL</span>, <span class="dt">title=</span><span class="st">"ggplot2 geom_dumbbell with dot guide"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb2-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggtheme.html">theme_minimal</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb2-9" data-line-number="9"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid.major.x=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_line</a></span>(<span class="dt">size=</span><span class="fl">0.05</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb2-10" data-line-number="10"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid.major.y=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_blank</a></span>())</a></code></pre></div>
<p><img src="dumbell_files/figure-html/dumbbell2-1.png"><!-- --></p>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#dumbbell-charts">Dumbbell Charts</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

BIN
docs/articles/dumbell_files/figure-html/dumbbell2-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

217
docs/articles/encircling.html

@ -0,0 +1,217 @@
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Encircling Points • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Encircling Points">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/annoticks.html">Annotation Ticks</a>
</li>
<li>
<a href="../articles/density.html">Density Plots</a>
</li>
<li>
<a href="../articles/dumbell.html">Dumbbell Charts</a>
</li>
<li>
<a href="../articles/encircling.html">Encircling Points</a>
</li>
<li>
<a href="../articles/horizon.html">Horizon Plots</a>
</li>
<li>
<a href="../articles/lollipop.html">Lollipop charts</a>
</li>
<li>
<a href="../articles/proj.html">Coord Projection</a>
</li>
<li>
<a href="../articles/spikelines.html">Spikelines</a>
</li>
<li>
<a href="../articles/splines.html">Spline Plots</a>
</li>
<li>
<a href="../articles/stateface.html">ProPublica StateFace</a>
</li>
<li>
<a href="../articles/stepribbon.html">Step Ribbons</a>
</li>
<li>
<a href="../articles/ubar.html">Uniform Bars</a>
</li>
<li>
<a href="../articles/verticaldodge.html">Vertical Dodging</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Encircling Points</h1>
<h4 class="author">Ben Bolker</h4>
<h4 class="date">2019-02-22</h4>
<small class="dont-index">Source: <a href="https://github.com/hrbrmstr/ggalt/blob/master/vignettes/encircling.Rmd"><code>vignettes/encircling.Rmd</code></a></small>
<div class="hidden name"><code>encircling.Rmd</code></div>
</div>
<div id="encircling-points-automagically" class="section level2">
<h2 class="hasAnchor">
<a href="#encircling-points-automagically" class="anchor"></a>Encircling points automagically</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">library</span>(ggplot2)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw">library</span>(gridExtra)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw">library</span>(ggalt)</a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="kw">library</span>(scales)</a></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"></a>
<a class="sourceLine" id="cb2-2" data-line-number="2">d &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">x=</span><span class="kw">c</span>(<span class="dv">1</span>,<span class="dv">1</span>,<span class="dv">2</span>),<span class="dt">y=</span><span class="kw">c</span>(<span class="dv">1</span>,<span class="dv">2</span>,<span class="dv">2</span>)<span class="op">*</span><span class="dv">100</span>)</a>
<a class="sourceLine" id="cb2-3" data-line-number="3"></a>
<a class="sourceLine" id="cb2-4" data-line-number="4">gg &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(d,<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x,y))</a>
<a class="sourceLine" id="cb2-5" data-line-number="5"></a>
<a class="sourceLine" id="cb2-6" data-line-number="6">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_x_continuous</a></span>(<span class="dt">expand=</span><span class="kw">c</span>(<span class="fl">0.5</span>,<span class="dv">1</span>))</a>
<a class="sourceLine" id="cb2-8" data-line-number="8"></a>
<a class="sourceLine" id="cb2-9" data-line-number="9">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-10" data-line-number="10"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_y_continuous</a></span>(<span class="dt">expand=</span><span class="kw">c</span>(<span class="fl">0.5</span>,<span class="dv">1</span>))</a>
<a class="sourceLine" id="cb2-11" data-line-number="11"></a>
<a class="sourceLine" id="cb2-12" data-line-number="12">gg <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-13" data-line-number="13"><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">s_shape=</span><span class="dv">1</span>, <span class="dt">expand=</span><span class="dv">0</span>) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-14" data-line-number="14"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="encircling_files/figure-html/encircle-1.png"><!-- --></p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"></a>
<a class="sourceLine" id="cb3-2" data-line-number="2">gg <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">s_shape=</span><span class="dv">1</span>, <span class="dt">expand=</span><span class="fl">0.1</span>, <span class="dt">colour=</span><span class="st">"red"</span>) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="encircling_files/figure-html/encircle-2.png"><!-- --></p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"></a>
<a class="sourceLine" id="cb4-2" data-line-number="2">gg <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">s_shape=</span><span class="fl">0.5</span>, <span class="dt">expand=</span><span class="fl">0.1</span>, <span class="dt">colour=</span><span class="st">"purple"</span>) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="encircling_files/figure-html/encircle-3.png"><!-- --></p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"></a>
<a class="sourceLine" id="cb5-2" data-line-number="2">gg <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">data=</span><span class="kw">subset</span>(d, x<span class="op">==</span><span class="dv">1</span>), <span class="dt">colour=</span><span class="st">"blue"</span>, <span class="dt">spread=</span><span class="fl">0.02</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="encircling_files/figure-html/encircle-4.png"><!-- --></p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"></a>
<a class="sourceLine" id="cb6-2" data-line-number="2">gg <span class="op">+</span></a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">data=</span><span class="kw">subset</span>(d, x<span class="op">==</span><span class="dv">2</span>), <span class="dt">colour=</span><span class="st">"cyan"</span>, <span class="dt">spread=</span><span class="fl">0.04</span>) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="encircling_files/figure-html/encircle-5.png"><!-- --></p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"></a>
<a class="sourceLine" id="cb7-2" data-line-number="2">gg &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(mpg, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(displ, hwy))</a>
<a class="sourceLine" id="cb7-3" data-line-number="3"></a>
<a class="sourceLine" id="cb7-4" data-line-number="4">gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">data=</span><span class="kw">subset</span>(mpg, hwy<span class="op">&gt;</span><span class="dv">40</span>)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="encircling_files/figure-html/unnamed-chunk-3-1.png"><!-- --></p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"></a>
<a class="sourceLine" id="cb8-2" data-line-number="2">ss &lt;-<span class="st"> </span><span class="kw">subset</span>(mpg,hwy<span class="op">&gt;</span><span class="dv">31</span> <span class="op">&amp;</span><span class="st"> </span>displ<span class="op">&lt;</span><span class="dv">2</span>)</a>
<a class="sourceLine" id="cb8-3" data-line-number="3"></a>
<a class="sourceLine" id="cb8-4" data-line-number="4">gg <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb8-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">data=</span>ss, <span class="dt">colour=</span><span class="st">"blue"</span>, <span class="dt">s_shape=</span><span class="fl">0.9</span>, <span class="dt">expand=</span><span class="fl">0.07</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb8-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>() <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb8-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>(<span class="dt">data=</span>ss, <span class="dt">colour=</span><span class="st">"blue"</span>)</a></code></pre></div>
<p><img src="encircling_files/figure-html/unnamed-chunk-3-2.png"><!-- --></p>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#encircling-points-automagically">Encircling points automagically</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

BIN
docs/articles/encircling_files/figure-html/encircle-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/articles/encircling_files/figure-html/encircle-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
docs/articles/encircling_files/figure-html/encircle-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/articles/encircling_files/figure-html/encircle-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
docs/articles/encircling_files/figure-html/encircle-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/articles/encircling_files/figure-html/unnamed-chunk-3-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
docs/articles/encircling_files/figure-html/unnamed-chunk-3-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

421
docs/articles/ggalt_examples.html

@ -0,0 +1,421 @@
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ggalt examples • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="ggalt examples">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/ggalt_examples.html">ggalt examples</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>ggalt examples</h1>
<h4 class="author">Bob Rudis</h4>
<h4 class="date">2019-02-22</h4>
<small class="dont-index">Source: <a href="https://github.com/hrbrmstr/ggalt/blob/master/vignettes/ggalt_examples.Rmd"><code>vignettes/ggalt_examples.Rmd</code></a></small>
<div class="hidden name"><code>ggalt_examples.Rmd</code></div>
</div>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">library</span>(ggplot2)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw">library</span>(gridExtra)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw">library</span>(ggalt)</a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="kw">library</span>(scales)</a>
<a class="sourceLine" id="cb1-5" data-line-number="5"></a>
<a class="sourceLine" id="cb1-6" data-line-number="6"><span class="co"># current verison</span></a>
<a class="sourceLine" id="cb1-7" data-line-number="7"><span class="kw">packageVersion</span>(<span class="st">"ggalt"</span>)</a>
<a class="sourceLine" id="cb1-8" data-line-number="8"><span class="co">## [1] '0.6.1'</span></a>
<a class="sourceLine" id="cb1-9" data-line-number="9"></a>
<a class="sourceLine" id="cb1-10" data-line-number="10"><span class="kw">set.seed</span>(<span class="dv">1492</span>)</a>
<a class="sourceLine" id="cb1-11" data-line-number="11">dat &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">x=</span><span class="kw">c</span>(<span class="dv">1</span><span class="op">:</span><span class="dv">10</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">10</span>, <span class="dv">1</span><span class="op">:</span><span class="dv">10</span>),</a>
<a class="sourceLine" id="cb1-12" data-line-number="12"> <span class="dt">y=</span><span class="kw">c</span>(<span class="kw">sample</span>(<span class="dv">15</span><span class="op">:</span><span class="dv">30</span>, <span class="dv">10</span>), <span class="dv">2</span><span class="op">*</span><span class="kw">sample</span>(<span class="dv">15</span><span class="op">:</span><span class="dv">30</span>, <span class="dv">10</span>), <span class="dv">3</span><span class="op">*</span><span class="kw">sample</span>(<span class="dv">15</span><span class="op">:</span><span class="dv">30</span>, <span class="dv">10</span>)),</a>
<a class="sourceLine" id="cb1-13" data-line-number="13"> <span class="dt">group=</span><span class="kw">factor</span>(<span class="kw">c</span>(<span class="kw">rep</span>(<span class="dv">1</span>, <span class="dv">10</span>), <span class="kw">rep</span>(<span class="dv">2</span>, <span class="dv">10</span>), <span class="kw">rep</span>(<span class="dv">3</span>, <span class="dv">10</span>)))</a>
<a class="sourceLine" id="cb1-14" data-line-number="14">)</a></code></pre></div>
<div id="splines" class="section level3">
<h3 class="hasAnchor">
<a href="#splines" class="anchor"></a>Splines!</h3>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y, <span class="dt">group=</span>group, <span class="dt">color=</span>group)) <span class="op">+</span></a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_path.html">geom_line</a></span>()</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/splines-1.png"><!-- --></p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"></a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y, <span class="dt">group=</span>group, <span class="dt">color=</span><span class="kw">factor</span>(group))) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_path.html">geom_line</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_smooth.html">geom_smooth</a></span>(<span class="dt">se=</span><span class="ot">FALSE</span>, <span class="dt">linetype=</span><span class="st">"dashed"</span>, <span class="dt">size=</span><span class="fl">0.5</span>)</a>
<a class="sourceLine" id="cb3-6" data-line-number="6"><span class="co">## `geom_smooth()` using method = 'loess' and formula 'y ~ x'</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/splines-2.png"><!-- --></p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y, <span class="dt">group=</span>group, <span class="dt">color=</span><span class="kw">factor</span>(group))) <span class="op">+</span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>(<span class="dt">color=</span><span class="st">"black"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_smooth.html">geom_smooth</a></span>(<span class="dt">se=</span><span class="ot">FALSE</span>, <span class="dt">linetype=</span><span class="st">"dashed"</span>, <span class="dt">size=</span><span class="fl">0.5</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb4-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_xspline.html">geom_xspline</a></span>(<span class="dt">size=</span><span class="fl">0.5</span>)</a>
<a class="sourceLine" id="cb4-6" data-line-number="6"><span class="co">## `geom_smooth()` using method = 'loess' and formula 'y ~ x'</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/splines-3.png"><!-- --></p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"></a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y, <span class="dt">group=</span>group, <span class="dt">color=</span><span class="kw">factor</span>(group))) <span class="op">+</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>(<span class="dt">color=</span><span class="st">"black"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_smooth.html">geom_smooth</a></span>(<span class="dt">se=</span><span class="ot">FALSE</span>, <span class="dt">linetype=</span><span class="st">"dashed"</span>, <span class="dt">size=</span><span class="fl">0.5</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_xspline.html">geom_xspline</a></span>(<span class="dt">spline_shape=</span><span class="op">-</span><span class="fl">0.4</span>, <span class="dt">size=</span><span class="fl">0.5</span>)</a>
<a class="sourceLine" id="cb5-6" data-line-number="6"><span class="co">## `geom_smooth()` using method = 'loess' and formula 'y ~ x'</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/splines-4.png"><!-- --></p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"></a>
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y, <span class="dt">group=</span>group, <span class="dt">color=</span><span class="kw">factor</span>(group))) <span class="op">+</span></a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>(<span class="dt">color=</span><span class="st">"black"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_smooth.html">geom_smooth</a></span>(<span class="dt">se=</span><span class="ot">FALSE</span>, <span class="dt">linetype=</span><span class="st">"dashed"</span>, <span class="dt">size=</span><span class="fl">0.5</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb6-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_xspline.html">geom_xspline</a></span>(<span class="dt">spline_shape=</span><span class="fl">0.4</span>, <span class="dt">size=</span><span class="fl">0.5</span>)</a>
<a class="sourceLine" id="cb6-6" data-line-number="6"><span class="co">## `geom_smooth()` using method = 'loess' and formula 'y ~ x'</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/splines-5.png"><!-- --></p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1"></a>
<a class="sourceLine" id="cb7-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y, <span class="dt">group=</span>group, <span class="dt">color=</span><span class="kw">factor</span>(group))) <span class="op">+</span></a>
<a class="sourceLine" id="cb7-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>(<span class="dt">color=</span><span class="st">"black"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb7-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_smooth.html">geom_smooth</a></span>(<span class="dt">se=</span><span class="ot">FALSE</span>, <span class="dt">linetype=</span><span class="st">"dashed"</span>, <span class="dt">size=</span><span class="fl">0.5</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb7-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_xspline.html">geom_xspline</a></span>(<span class="dt">spline_shape=</span><span class="dv">1</span>, <span class="dt">size=</span><span class="fl">0.5</span>)</a>
<a class="sourceLine" id="cb7-6" data-line-number="6"><span class="co">## `geom_smooth()` using method = 'loess' and formula 'y ~ x'</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/splines-6.png"><!-- --></p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1"></a>
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y, <span class="dt">group=</span>group, <span class="dt">color=</span><span class="kw">factor</span>(group))) <span class="op">+</span></a>
<a class="sourceLine" id="cb8-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>(<span class="dt">color=</span><span class="st">"black"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb8-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_smooth.html">geom_smooth</a></span>(<span class="dt">se=</span><span class="ot">FALSE</span>, <span class="dt">linetype=</span><span class="st">"dashed"</span>, <span class="dt">size=</span><span class="fl">0.5</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb8-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_xspline.html">geom_xspline</a></span>(<span class="dt">spline_shape=</span><span class="dv">0</span>, <span class="dt">size=</span><span class="fl">0.5</span>)</a>
<a class="sourceLine" id="cb8-6" data-line-number="6"><span class="co">## `geom_smooth()` using method = 'loess' and formula 'y ~ x'</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/splines-7.png"><!-- --></p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1"></a>
<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y, <span class="dt">group=</span>group, <span class="dt">color=</span><span class="kw">factor</span>(group))) <span class="op">+</span></a>
<a class="sourceLine" id="cb9-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>(<span class="dt">color=</span><span class="st">"black"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb9-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_smooth.html">geom_smooth</a></span>(<span class="dt">se=</span><span class="ot">FALSE</span>, <span class="dt">linetype=</span><span class="st">"dashed"</span>, <span class="dt">size=</span><span class="fl">0.5</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb9-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_xspline.html">geom_xspline</a></span>(<span class="dt">spline_shape=</span><span class="op">-</span><span class="dv">1</span>, <span class="dt">size=</span><span class="fl">0.5</span>)</a>
<a class="sourceLine" id="cb9-6" data-line-number="6"><span class="co">## `geom_smooth()` using method = 'loess' and formula 'y ~ x'</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/splines-8.png"><!-- --></p>
<div id="alternate-better-density-plots" class="section level4">
<h4 class="hasAnchor">
<a href="#alternate-better-density-plots" class="anchor"></a>Alternate (better) density plots</h4>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="co"># bkde</span></a>
<a class="sourceLine" id="cb10-2" data-line-number="2"></a>
<a class="sourceLine" id="cb10-3" data-line-number="3"><span class="kw">data</span>(geyser, <span class="dt">package=</span><span class="st">"MASS"</span>)</a>
<a class="sourceLine" id="cb10-4" data-line-number="4"></a>
<a class="sourceLine" id="cb10-5" data-line-number="5"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(geyser, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>duration)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb10-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">stat_bkde</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">2</span>)</a>
<a class="sourceLine" id="cb10-7" data-line-number="7"><span class="co">## Bandwidth not specified. Using '0.14', via KernSmooth::dpik.</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde_ash-1.png"><!-- --></p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1"></a>
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(geyser, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>duration)) <span class="op">+</span></a>
<a class="sourceLine" id="cb11-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">geom_bkde</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">2</span>)</a>
<a class="sourceLine" id="cb11-4" data-line-number="4"><span class="co">## Bandwidth not specified. Using '0.14', via KernSmooth::dpik.</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde_ash-2.png"><!-- --></p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1"></a>
<a class="sourceLine" id="cb12-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(geyser, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>duration)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb12-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">stat_bkde</a></span>(<span class="dt">bandwidth=</span><span class="fl">0.25</span>)</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde_ash-3.png"><!-- --></p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1"></a>
<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(geyser, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>duration)) <span class="op">+</span></a>
<a class="sourceLine" id="cb13-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">geom_bkde</a></span>(<span class="dt">bandwidth=</span><span class="fl">0.25</span>)</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde_ash-4.png"><!-- --></p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1"></a>
<a class="sourceLine" id="cb14-2" data-line-number="2"><span class="kw">set.seed</span>(<span class="dv">1492</span>)</a>
<a class="sourceLine" id="cb14-3" data-line-number="3">dat &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">cond =</span> <span class="kw">factor</span>(<span class="kw">rep</span>(<span class="kw">c</span>(<span class="st">"A"</span>,<span class="st">"B"</span>), <span class="dt">each=</span><span class="dv">200</span>)), </a>
<a class="sourceLine" id="cb14-4" data-line-number="4"> <span class="dt">rating =</span> <span class="kw">c</span>(<span class="kw">rnorm</span>(<span class="dv">200</span>),<span class="kw">rnorm</span>(<span class="dv">200</span>, <span class="dt">mean=</span>.<span class="dv">8</span>)))</a>
<a class="sourceLine" id="cb14-5" data-line-number="5"></a>
<a class="sourceLine" id="cb14-6" data-line-number="6"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>rating, <span class="dt">color=</span>cond)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">geom_bkde</a></span>(<span class="dt">fill=</span><span class="st">"#00000000"</span>)</a>
<a class="sourceLine" id="cb14-7" data-line-number="7"><span class="co">## Bandwidth not specified. Using '0.36', via KernSmooth::dpik.</span></a>
<a class="sourceLine" id="cb14-8" data-line-number="8"><span class="co">## Bandwidth not specified. Using '0.31', via KernSmooth::dpik.</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde_ash-5.png"><!-- --></p>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" data-line-number="1"></a>
<a class="sourceLine" id="cb15-2" data-line-number="2"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>rating, <span class="dt">fill=</span>cond)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">geom_bkde</a></span>(<span class="dt">alpha=</span><span class="fl">0.3</span>)</a>
<a class="sourceLine" id="cb15-3" data-line-number="3"><span class="co">## Bandwidth not specified. Using '0.36', via KernSmooth::dpik.</span></a>
<a class="sourceLine" id="cb15-4" data-line-number="4"><span class="co">## Bandwidth not specified. Using '0.31', via KernSmooth::dpik.</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde_ash-6.png"><!-- --></p>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" data-line-number="1"></a>
<a class="sourceLine" id="cb16-2" data-line-number="2"><span class="co"># ash</span></a>
<a class="sourceLine" id="cb16-3" data-line-number="3"></a>
<a class="sourceLine" id="cb16-4" data-line-number="4"><span class="kw">set.seed</span>(<span class="dv">1492</span>)</a>
<a class="sourceLine" id="cb16-5" data-line-number="5">dat &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">x=</span><span class="kw">rnorm</span>(<span class="dv">100</span>))</a>
<a class="sourceLine" id="cb16-6" data-line-number="6"><span class="kw"><a href="http://www.rdocumentation.org/packages/gridExtra/topics/arrangeGrob">grid.arrange</a></span>(<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/stat_ash.html">stat_ash</a></span>(),</a>
<a class="sourceLine" id="cb16-7" data-line-number="7"> <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">stat_bkde</a></span>(),</a>
<a class="sourceLine" id="cb16-8" data-line-number="8"> <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_density.html">stat_density</a></span>(),</a>
<a class="sourceLine" id="cb16-9" data-line-number="9"> <span class="dt">nrow=</span><span class="dv">3</span>)</a>
<a class="sourceLine" id="cb16-10" data-line-number="10"><span class="co">## Estimate nonzero outside interval ab.</span></a>
<a class="sourceLine" id="cb16-11" data-line-number="11"><span class="co">## Bandwidth not specified. Using '0.43', via KernSmooth::dpik.</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde_ash-7.png"><!-- --></p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" data-line-number="1"></a>
<a class="sourceLine" id="cb17-2" data-line-number="2">cols &lt;-<span class="st"> </span>RColorBrewer<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/RColorBrewer/topics/ColorBrewer">brewer.pal</a></span>(<span class="dv">3</span>, <span class="st">"Dark2"</span>)</a>
<a class="sourceLine" id="cb17-3" data-line-number="3"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="../reference/stat_ash.html">stat_ash</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">3</span>, <span class="dt">fill=</span>cols[<span class="dv">3</span>]) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde.html">stat_bkde</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">3</span>, <span class="dt">fill=</span>cols[<span class="dv">2</span>]) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_density.html">stat_density</a></span>(<span class="dt">alpha=</span><span class="dv">1</span><span class="op">/</span><span class="dv">3</span>, <span class="dt">fill=</span>cols[<span class="dv">1</span>]) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb17-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_rug.html">geom_rug</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb17-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/labs.html">labs</a></span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="st">"density/estimate"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb17-9" data-line-number="9"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_x_continuous</a></span>(<span class="dt">expand=</span><span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">0</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb17-10" data-line-number="10"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggtheme.html">theme_bw</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb17-11" data-line-number="11"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_blank</a></span>()) <span class="op">+</span></a>
<a class="sourceLine" id="cb17-12" data-line-number="12"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.border=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_blank</a></span>())</a>
<a class="sourceLine" id="cb17-13" data-line-number="13"><span class="co">## Estimate nonzero outside interval ab.</span></a>
<a class="sourceLine" id="cb17-14" data-line-number="14"><span class="co">## Bandwidth not specified. Using '0.43', via KernSmooth::dpik.</span></a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde_ash-8.png"><!-- --></p>
</div>
</div>
<div id="alternate-2d-density-plots" class="section level3">
<h3 class="hasAnchor">
<a href="#alternate-2d-density-plots" class="anchor"></a>Alternate 2D density plots</h3>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb18-1" data-line-number="1">m &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(faithful, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x =</span> eruptions, <span class="dt">y =</span> waiting)) <span class="op">+</span></a>
<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb18-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/lims.html">xlim</a></span>(<span class="fl">0.5</span>, <span class="dv">6</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb18-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/lims.html">ylim</a></span>(<span class="dv">40</span>, <span class="dv">110</span>)</a>
<a class="sourceLine" id="cb18-5" data-line-number="5"></a>
<a class="sourceLine" id="cb18-6" data-line-number="6">m <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde2d.html">geom_bkde2d</a></span>(<span class="dt">bandwidth=</span><span class="kw">c</span>(<span class="fl">0.5</span>, <span class="dv">4</span>))</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde2d-1.png"><!-- --></p>
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb19-1" data-line-number="1"></a>
<a class="sourceLine" id="cb19-2" data-line-number="2">m <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_bkde2d.html">stat_bkde2d</a></span>(<span class="dt">bandwidth=</span><span class="kw">c</span>(<span class="fl">0.5</span>, <span class="dv">4</span>), <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">fill =</span> ..level..), <span class="dt">geom =</span> <span class="st">"polygon"</span>)</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/bkde2d-2.png"><!-- --></p>
</div>
<div id="propublica-stateface" class="section level3">
<h3 class="hasAnchor">
<a href="#propublica-stateface" class="anchor"></a>ProPublica StateFace</h3>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb20-1" data-line-number="1"><span class="co"># Run show_stateface() to see the location of the TTF StateFace font</span></a>
<a class="sourceLine" id="cb20-2" data-line-number="2"><span class="co"># You need to install it for it to work</span></a>
<a class="sourceLine" id="cb20-3" data-line-number="3"></a>
<a class="sourceLine" id="cb20-4" data-line-number="4"><span class="kw">set.seed</span>(<span class="dv">1492</span>)</a>
<a class="sourceLine" id="cb20-5" data-line-number="5">dat &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">state=</span>state.abb,</a>
<a class="sourceLine" id="cb20-6" data-line-number="6"> <span class="dt">x=</span><span class="kw">sample</span>(<span class="dv">100</span>, <span class="dv">50</span>),</a>
<a class="sourceLine" id="cb20-7" data-line-number="7"> <span class="dt">y=</span><span class="kw">sample</span>(<span class="dv">100</span>, <span class="dv">50</span>),</a>
<a class="sourceLine" id="cb20-8" data-line-number="8"> <span class="dt">col=</span><span class="kw">sample</span>(<span class="kw">c</span>(<span class="st">"#b2182b"</span>, <span class="st">"#2166ac"</span>), <span class="dv">50</span>, <span class="dt">replace=</span><span class="ot">TRUE</span>),</a>
<a class="sourceLine" id="cb20-9" data-line-number="9"> <span class="dt">sz=</span><span class="kw">sample</span>(<span class="dv">6</span><span class="op">:</span><span class="dv">15</span>, <span class="dv">50</span>, <span class="dt">replace=</span><span class="ot">TRUE</span>),</a>
<a class="sourceLine" id="cb20-10" data-line-number="10"> <span class="dt">stringsAsFactors=</span><span class="ot">FALSE</span>)</a>
<a class="sourceLine" id="cb20-11" data-line-number="11">gg &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(dat, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">x=</span>x, <span class="dt">y=</span>y))</a>
<a class="sourceLine" id="cb20-12" data-line-number="12">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_stateface.html">geom_stateface</a></span>(<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">label=</span>state, <span class="dt">color=</span>col, <span class="dt">size=</span>sz))</a>
<a class="sourceLine" id="cb20-13" data-line-number="13">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_identity.html">scale_color_identity</a></span>()</a>
<a class="sourceLine" id="cb20-14" data-line-number="14">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_identity.html">scale_size_identity</a></span>()</a>
<a class="sourceLine" id="cb20-15" data-line-number="15">gg</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/stateface-1.png"><!-- --></p>
</div>
<div id="encircling-points-automagically" class="section level3">
<h3 class="hasAnchor">
<a href="#encircling-points-automagically" class="anchor"></a>Encircling points automagically</h3>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb21-1" data-line-number="1">d &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">x=</span><span class="kw">c</span>(<span class="dv">1</span>,<span class="dv">1</span>,<span class="dv">2</span>),<span class="dt">y=</span><span class="kw">c</span>(<span class="dv">1</span>,<span class="dv">2</span>,<span class="dv">2</span>)<span class="op">*</span><span class="dv">100</span>)</a>
<a class="sourceLine" id="cb21-2" data-line-number="2"></a>
<a class="sourceLine" id="cb21-3" data-line-number="3">gg &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(d,<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x,y))</a>
<a class="sourceLine" id="cb21-4" data-line-number="4">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_x_continuous</a></span>(<span class="dt">expand=</span><span class="kw">c</span>(<span class="fl">0.5</span>,<span class="dv">1</span>))</a>
<a class="sourceLine" id="cb21-5" data-line-number="5">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_y_continuous</a></span>(<span class="dt">expand=</span><span class="kw">c</span>(<span class="fl">0.5</span>,<span class="dv">1</span>))</a>
<a class="sourceLine" id="cb21-6" data-line-number="6"></a>
<a class="sourceLine" id="cb21-7" data-line-number="7">gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">s_shape=</span><span class="dv">1</span>, <span class="dt">expand=</span><span class="dv">0</span>) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/encircle-1.png"><!-- --></p>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb22-1" data-line-number="1"></a>
<a class="sourceLine" id="cb22-2" data-line-number="2">gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">s_shape=</span><span class="dv">1</span>, <span class="dt">expand=</span><span class="fl">0.1</span>, <span class="dt">colour=</span><span class="st">"red"</span>) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/encircle-2.png"><!-- --></p>
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb23-1" data-line-number="1"></a>
<a class="sourceLine" id="cb23-2" data-line-number="2">gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">s_shape=</span><span class="fl">0.5</span>, <span class="dt">expand=</span><span class="fl">0.1</span>, <span class="dt">colour=</span><span class="st">"purple"</span>) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/encircle-3.png"><!-- --></p>
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb24-1" data-line-number="1"></a>
<a class="sourceLine" id="cb24-2" data-line-number="2">gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">data=</span><span class="kw">subset</span>(d, x<span class="op">==</span><span class="dv">1</span>), <span class="dt">colour=</span><span class="st">"blue"</span>, <span class="dt">spread=</span><span class="fl">0.02</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb24-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/encircle-4.png"><!-- --></p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb25-1" data-line-number="1"></a>
<a class="sourceLine" id="cb25-2" data-line-number="2">gg <span class="op">+</span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">data=</span><span class="kw">subset</span>(d, x<span class="op">==</span><span class="dv">2</span>), <span class="dt">colour=</span><span class="st">"cyan"</span>, <span class="dt">spread=</span><span class="fl">0.04</span>) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb25-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/encircle-5.png"><!-- --></p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb26-1" data-line-number="1"></a>
<a class="sourceLine" id="cb26-2" data-line-number="2">gg &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(mpg, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(displ, hwy))</a>
<a class="sourceLine" id="cb26-3" data-line-number="3">gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">data=</span><span class="kw">subset</span>(mpg, hwy<span class="op">&gt;</span><span class="dv">40</span>)) <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>()</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/encircle-6.png"><!-- --></p>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb27-1" data-line-number="1"></a>
<a class="sourceLine" id="cb27-2" data-line-number="2">ss &lt;-<span class="st"> </span><span class="kw">subset</span>(mpg,hwy<span class="op">&gt;</span><span class="dv">31</span> <span class="op">&amp;</span><span class="st"> </span>displ<span class="op">&lt;</span><span class="dv">2</span>)</a>
<a class="sourceLine" id="cb27-3" data-line-number="3"></a>
<a class="sourceLine" id="cb27-4" data-line-number="4">gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_encircle.html">geom_encircle</a></span>(<span class="dt">data=</span>ss, <span class="dt">colour=</span><span class="st">"blue"</span>, <span class="dt">s_shape=</span><span class="fl">0.9</span>, <span class="dt">expand=</span><span class="fl">0.07</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb27-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>() <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_point.html">geom_point</a></span>(<span class="dt">data=</span>ss, <span class="dt">colour=</span><span class="st">"blue"</span>)</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/encircle-7.png"><!-- --></p>
</div>
<div id="step-ribbons" class="section level3">
<h3 class="hasAnchor">
<a href="#step-ribbons" class="anchor"></a>Step ribbons</h3>
<div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb28-1" data-line-number="1">x &lt;-<span class="st"> </span><span class="dv">1</span><span class="op">:</span><span class="dv">10</span></a>
<a class="sourceLine" id="cb28-2" data-line-number="2">df &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">x=</span>x, <span class="dt">y=</span>x<span class="op">+</span><span class="dv">10</span>, <span class="dt">ymin=</span>x<span class="op">+</span><span class="dv">7</span>, <span class="dt">ymax=</span>x<span class="op">+</span><span class="dv">12</span>)</a>
<a class="sourceLine" id="cb28-3" data-line-number="3"></a>
<a class="sourceLine" id="cb28-4" data-line-number="4">gg &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(df, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y))</a>
<a class="sourceLine" id="cb28-5" data-line-number="5">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_ribbon.html">geom_ribbon</a></span>(<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">ymin=</span>ymin, <span class="dt">ymax=</span>ymax),</a>
<a class="sourceLine" id="cb28-6" data-line-number="6"> <span class="dt">stat=</span><span class="st">"stepribbon"</span>, <span class="dt">fill=</span><span class="st">"#b2b2b2"</span>)</a>
<a class="sourceLine" id="cb28-7" data-line-number="7">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_path.html">geom_step</a></span>(<span class="dt">color=</span><span class="st">"#2b2b2b"</span>)</a>
<a class="sourceLine" id="cb28-8" data-line-number="8">gg</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/stepribbon-1.png"><!-- --></p>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb29-1" data-line-number="1"></a>
<a class="sourceLine" id="cb29-2" data-line-number="2">gg &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(df, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(x, y))</a>
<a class="sourceLine" id="cb29-3" data-line-number="3">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_ribbon.html">geom_ribbon</a></span>(<span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">ymin=</span>ymin, <span class="dt">ymax=</span>ymax),</a>
<a class="sourceLine" id="cb29-4" data-line-number="4"> <span class="dt">stat=</span><span class="st">"stepribbon"</span>, <span class="dt">fill=</span><span class="st">"#b2b2b2"</span>,</a>
<a class="sourceLine" id="cb29-5" data-line-number="5"> <span class="dt">direction=</span><span class="st">"vh"</span>)</a>
<a class="sourceLine" id="cb29-6" data-line-number="6">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/geom_path.html">geom_step</a></span>(<span class="dt">color=</span><span class="st">"#2b2b2b"</span>)</a>
<a class="sourceLine" id="cb29-7" data-line-number="7">gg</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/stepribbon-2.png"><!-- --></p>
</div>
<div id="lollipop-charts" class="section level3">
<h3 class="hasAnchor">
<a href="#lollipop-charts" class="anchor"></a>Lollipop charts</h3>
<div class="sourceCode" id="cb30"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb30-1" data-line-number="1">df &lt;-<span class="st"> </span><span class="kw">read.csv</span>(<span class="dt">text=</span><span class="st">"category,pct</span></a>
<a class="sourceLine" id="cb30-2" data-line-number="2"><span class="st">Other,0.09</span></a>
<a class="sourceLine" id="cb30-3" data-line-number="3"><span class="st">South Asian/South Asian Americans,0.12</span></a>
<a class="sourceLine" id="cb30-4" data-line-number="4"><span class="st">Interngenerational/Generational,0.21</span></a>
<a class="sourceLine" id="cb30-5" data-line-number="5"><span class="st">S Asian/Asian Americans,0.25</span></a>
<a class="sourceLine" id="cb30-6" data-line-number="6"><span class="st">Muslim Observance,0.29</span></a>
<a class="sourceLine" id="cb30-7" data-line-number="7"><span class="st">Africa/Pan Africa/African Americans,0.34</span></a>
<a class="sourceLine" id="cb30-8" data-line-number="8"><span class="st">Gender Equity,0.34</span></a>
<a class="sourceLine" id="cb30-9" data-line-number="9"><span class="st">Disability Advocacy,0.49</span></a>
<a class="sourceLine" id="cb30-10" data-line-number="10"><span class="st">European/European Americans,0.52</span></a>
<a class="sourceLine" id="cb30-11" data-line-number="11"><span class="st">Veteran,0.54</span></a>
<a class="sourceLine" id="cb30-12" data-line-number="12"><span class="st">Pacific Islander/Pacific Islander Americans,0.59</span></a>
<a class="sourceLine" id="cb30-13" data-line-number="13"><span class="st">Non-Traditional Students,0.61</span></a>
<a class="sourceLine" id="cb30-14" data-line-number="14"><span class="st">Religious Equity,0.64</span></a>
<a class="sourceLine" id="cb30-15" data-line-number="15"><span class="st">Caribbean/Caribbean Americans,0.67</span></a>
<a class="sourceLine" id="cb30-16" data-line-number="16"><span class="st">Latino/Latina,0.69</span></a>
<a class="sourceLine" id="cb30-17" data-line-number="17"><span class="st">Middle Eastern Heritages and Traditions,0.73</span></a>
<a class="sourceLine" id="cb30-18" data-line-number="18"><span class="st">Trans-racial Adoptee/Parent,0.76</span></a>
<a class="sourceLine" id="cb30-19" data-line-number="19"><span class="st">LBGTQ/Ally,0.79</span></a>
<a class="sourceLine" id="cb30-20" data-line-number="20"><span class="st">Mixed Race,0.80</span></a>
<a class="sourceLine" id="cb30-21" data-line-number="21"><span class="st">Jewish Heritage/Observance,0.85</span></a>
<a class="sourceLine" id="cb30-22" data-line-number="22"><span class="st">International Students,0.87"</span>, <span class="dt">stringsAsFactors=</span><span class="ot">FALSE</span>, <span class="dt">sep=</span><span class="st">","</span>, <span class="dt">header=</span><span class="ot">TRUE</span>)</a>
<a class="sourceLine" id="cb30-23" data-line-number="23"></a>
<a class="sourceLine" id="cb30-24" data-line-number="24">gg &lt;-<span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(df, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">y=</span><span class="kw">reorder</span>(category, pct), <span class="dt">x=</span>pct))</a>
<a class="sourceLine" id="cb30-25" data-line-number="25">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="../reference/geom_lollipop.html">geom_lollipop</a></span>(<span class="dt">point.colour=</span><span class="st">"steelblue"</span>, <span class="dt">point.size=</span><span class="dv">2</span>, <span class="dt">horizontal=</span><span class="ot">TRUE</span>)</a>
<a class="sourceLine" id="cb30-26" data-line-number="26">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/scale_continuous.html">scale_x_continuous</a></span>(<span class="dt">expand=</span><span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">0</span>), <span class="dt">labels=</span>percent,</a>
<a class="sourceLine" id="cb30-27" data-line-number="27"> <span class="dt">breaks=</span><span class="kw">seq</span>(<span class="dv">0</span>, <span class="dv">1</span>, <span class="dt">by=</span><span class="fl">0.2</span>), <span class="dt">limits=</span><span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">1</span>))</a>
<a class="sourceLine" id="cb30-28" data-line-number="28">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/labs.html">labs</a></span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="ot">NULL</span>, </a>
<a class="sourceLine" id="cb30-29" data-line-number="29"> <span class="dt">title=</span><span class="st">"SUNY Cortland Multicultural Alumni survey results"</span>,</a>
<a class="sourceLine" id="cb30-30" data-line-number="30"> <span class="dt">subtitle=</span><span class="st">"Ranked by race, ethnicity, home land and orientation</span><span class="ch">\n</span><span class="st">among the top areas of concern"</span>,</a>
<a class="sourceLine" id="cb30-31" data-line-number="31"> <span class="dt">caption=</span><span class="st">"Data from http://stephanieevergreen.com/lollipop/"</span>)</a>
<a class="sourceLine" id="cb30-32" data-line-number="32">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggtheme.html">theme_minimal</a></span>()</a>
<a class="sourceLine" id="cb30-33" data-line-number="33">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid.major.y=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_blank</a></span>())</a>
<a class="sourceLine" id="cb30-34" data-line-number="34">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid.minor=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_blank</a></span>())</a>
<a class="sourceLine" id="cb30-35" data-line-number="35">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">axis.line.y=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_line</a></span>(<span class="dt">color=</span><span class="st">"#2b2b2b"</span>, <span class="dt">size=</span><span class="fl">0.15</span>))</a>
<a class="sourceLine" id="cb30-36" data-line-number="36">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">axis.text.y=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_text</a></span>(<span class="dt">margin=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">margin</a></span>(<span class="dt">r=</span><span class="dv">0</span>, <span class="dt">l=</span><span class="dv">0</span>)))</a>
<a class="sourceLine" id="cb30-37" data-line-number="37">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">plot.margin=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/reexports.html">unit</a></span>(<span class="kw">rep</span>(<span class="dv">30</span>, <span class="dv">4</span>), <span class="st">"pt"</span>))</a>
<a class="sourceLine" id="cb30-38" data-line-number="38">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">plot.title=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_text</a></span>(<span class="dt">face=</span><span class="st">"bold"</span>))</a>
<a class="sourceLine" id="cb30-39" data-line-number="39">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">plot.subtitle=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_text</a></span>(<span class="dt">margin=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">margin</a></span>(<span class="dt">b=</span><span class="dv">10</span>)))</a>
<a class="sourceLine" id="cb30-40" data-line-number="40">gg &lt;-<span class="st"> </span>gg <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">plot.caption=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_text</a></span>(<span class="dt">size=</span><span class="dv">8</span>, <span class="dt">margin=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">margin</a></span>(<span class="dt">t=</span><span class="dv">10</span>)))</a>
<a class="sourceLine" id="cb30-41" data-line-number="41">gg</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/lollipop-1.png"><!-- --></p>
</div>
<div id="dumbbell-charts" class="section level3">
<h3 class="hasAnchor">
<a href="#dumbbell-charts" class="anchor"></a>Dumbbell charts</h3>
<div class="sourceCode" id="cb31"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb31-1" data-line-number="1">df &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">trt=</span>LETTERS[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>], <span class="dt">l=</span><span class="kw">c</span>(<span class="dv">20</span>, <span class="dv">40</span>, <span class="dv">10</span>, <span class="dv">30</span>, <span class="dv">50</span>), <span class="dt">r=</span><span class="kw">c</span>(<span class="dv">70</span>, <span class="dv">50</span>, <span class="dv">30</span>, <span class="dv">60</span>, <span class="dv">80</span>))</a>
<a class="sourceLine" id="cb31-2" data-line-number="2"></a>
<a class="sourceLine" id="cb31-3" data-line-number="3"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(df, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">y=</span>trt, <span class="dt">x=</span>l, <span class="dt">xend=</span>r)) <span class="op">+</span><span class="st"> </span></a>
<a class="sourceLine" id="cb31-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="../reference/geom_dumbbell.html">geom_dumbbell</a></span>(<span class="dt">size=</span><span class="dv">3</span>, <span class="dt">color=</span><span class="st">"#e3e2e1"</span>, </a>
<a class="sourceLine" id="cb31-5" data-line-number="5"> <span class="dt">colour_x =</span> <span class="st">"#5b8124"</span>, <span class="dt">colour_xend =</span> <span class="st">"#bad744"</span>,</a>
<a class="sourceLine" id="cb31-6" data-line-number="6"> <span class="dt">dot_guide=</span><span class="ot">TRUE</span>, <span class="dt">dot_guide_size=</span><span class="fl">0.25</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb31-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/labs.html">labs</a></span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="ot">NULL</span>, <span class="dt">title=</span><span class="st">"ggplot2 geom_dumbbell with dot guide"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb31-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggtheme.html">theme_minimal</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb31-9" data-line-number="9"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid.major.x=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_line</a></span>(<span class="dt">size=</span><span class="fl">0.05</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb31-10" data-line-number="10"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid.major.y=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_blank</a></span>())</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/dumbbell2-1.png"><!-- --></p>
<p>with optional vertical dodging</p>
<div class="sourceCode" id="cb32"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb32-1" data-line-number="1">df2 &lt;-<span class="st"> </span><span class="kw">data.frame</span>(<span class="dt">trt =</span> <span class="kw">c</span>(LETTERS[<span class="dv">1</span><span class="op">:</span><span class="dv">5</span>], <span class="st">"D"</span>),</a>
<a class="sourceLine" id="cb32-2" data-line-number="2"> <span class="dt">l =</span> <span class="kw">c</span>(<span class="dv">20</span>, <span class="dv">40</span>, <span class="dv">10</span>, <span class="dv">30</span>, <span class="dv">50</span>, <span class="dv">40</span>),</a>
<a class="sourceLine" id="cb32-3" data-line-number="3"> <span class="dt">r =</span> <span class="kw">c</span>(<span class="dv">70</span>, <span class="dv">50</span>, <span class="dv">30</span>, <span class="dv">60</span>, <span class="dv">80</span>, <span class="dv">70</span>))</a>
<a class="sourceLine" id="cb32-4" data-line-number="4"></a>
<a class="sourceLine" id="cb32-5" data-line-number="5"><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot</a></span>(df2, <span class="kw"><a href="https://ggplot2.tidyverse.org/reference/aes.html">aes</a></span>(<span class="dt">y=</span>trt, <span class="dt">x=</span>l, <span class="dt">xend=</span>r)) <span class="op">+</span></a>
<a class="sourceLine" id="cb32-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="../reference/geom_dumbbell.html">geom_dumbbell</a></span>(<span class="dt">size=</span><span class="dv">3</span>, <span class="dt">color=</span><span class="st">"#e3e2e1"</span>,</a>
<a class="sourceLine" id="cb32-7" data-line-number="7"> <span class="dt">colour_x =</span> <span class="st">"#5b8124"</span>, <span class="dt">colour_xend =</span> <span class="st">"#bad744"</span>,</a>
<a class="sourceLine" id="cb32-8" data-line-number="8"> <span class="dt">dot_guide=</span><span class="ot">TRUE</span>, <span class="dt">dot_guide_size=</span><span class="fl">0.25</span>,</a>
<a class="sourceLine" id="cb32-9" data-line-number="9"> <span class="dt">position=</span><span class="kw"><a href="../reference/position-dodgev.html">position_dodgev</a></span>(<span class="dt">height=</span><span class="fl">0.8</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb32-10" data-line-number="10"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/labs.html">labs</a></span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="ot">NULL</span>, <span class="dt">title=</span><span class="st">"ggplot2 geom_dumbbell with dot guide"</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb32-11" data-line-number="11"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/ggtheme.html">theme_minimal</a></span>() <span class="op">+</span></a>
<a class="sourceLine" id="cb32-12" data-line-number="12"><span class="st"> </span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/theme.html">theme</a></span>(<span class="dt">panel.grid.major.x=</span><span class="kw"><a href="https://ggplot2.tidyverse.org/reference/element.html">element_line</a></span>(<span class="dt">size=</span><span class="fl">0.05</span>))</a></code></pre></div>
<p><img src="ggalt_examples_files/figure-html/dumbbellv-1.png"><!-- --></p>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
</div>
</div>
<footer><div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

BIN
docs/articles/ggalt_examples_files/figure-html/bkde2d-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde2d-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde_ash-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde_ash-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde_ash-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde_ash-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde_ash-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde_ash-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde_ash-7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/bkde_ash-8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/dumbbell2-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/dumbbellv-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/encircle-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/encircle-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/encircle-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/encircle-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/encircle-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/encircle-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/encircle-7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/lollipop-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/splines-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/splines-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/splines-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/splines-4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/splines-5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/splines-6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/splines-7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/splines-8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/stateface-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/stepribbon-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
docs/articles/ggalt_examples_files/figure-html/stepribbon-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

207
docs/articles/horizon.html

@ -0,0 +1,207 @@
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Horizon Plots • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Horizon Plots">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/annoticks.html">Annotation Ticks</a>
</li>
<li>
<a href="../articles/density.html">Density Plots</a>
</li>
<li>
<a href="../articles/dumbell.html">Dumbbell Charts</a>
</li>
<li>
<a href="../articles/encircling.html">Encircling Points</a>
</li>
<li>
<a href="../articles/horizon.html">Horizon Plots</a>
</li>
<li>
<a href="../articles/lollipop.html">Lollipop charts</a>
</li>
<li>
<a href="../articles/proj.html">Coord Projection</a>
</li>
<li>
<a href="../articles/spikelines.html">Spikelines</a>
</li>
<li>
<a href="../articles/splines.html">Spline Plots</a>
</li>
<li>
<a href="../articles/stateface.html">ProPublica StateFace</a>
</li>
<li>
<a href="../articles/stepribbon.html">Step Ribbons</a>
</li>
<li>
<a href="../articles/ubar.html">Uniform Bars</a>
</li>
<li>
<a href="../articles/verticaldodge.html">Vertical Dodging</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Horizon Plots</h1>
<h4 class="author">Aditya Kothari</h4>
<h4 class="date">2019-02-22</h4>
<small class="dont-index">Source: <a href="https://github.com/hrbrmstr/ggalt/blob/master/vignettes/horizon.Rmd"><code>vignettes/horizon.Rmd</code></a></small>
<div class="hidden name"><code>horizon.Rmd</code></div>
</div>
<div id="horzon-charts" class="section level2">
<h2 class="hasAnchor">
<a href="#horzon-charts" class="anchor"></a>Horzon Charts</h2>
<p>Example carved from: <a href="https://github.com/halhen/viz-pub/blob/master/sports-time-of-day/2_gen_chart.R" class="uri">https://github.com/halhen/viz-pub/blob/master/sports-time-of-day/2_gen_chart.R</a></p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">library</span>(hrbrthemes)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw">library</span>(ggalt)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw">library</span>(readr)</a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="kw">library</span>(dplyr)</a></code></pre></div>
<p>Set up data</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"></a>
<a class="sourceLine" id="cb2-2" data-line-number="2">sports &lt;-<span class="st"> </span><span class="kw"><a href="https://readr.tidyverse.org/reference/read_delim.html">read_tsv</a></span>(<span class="st">"https://github.com/halhen/viz-pub/raw/master/sports-time-of-day/activity.tsv"</span>)</a>
<a class="sourceLine" id="cb2-3" data-line-number="3"></a>
<a class="sourceLine" id="cb2-4" data-line-number="4">sports <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-5" data-line-number="5"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">group_by</a></span>(activity) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(<span class="kw">max</span>(p) <span class="op">&gt;</span><span class="st"> </span><span class="fl">3e-04</span>, </a>
<a class="sourceLine" id="cb2-7" data-line-number="7"> <span class="op">!</span><span class="kw">grepl</span>(<span class="st">'n</span><span class="ch">\\</span><span class="st">.e</span><span class="ch">\\</span><span class="st">.c'</span>, activity)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-8" data-line-number="8"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/arrange.html">arrange</a></span>(time) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-9" data-line-number="9"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">p_peak =</span> p <span class="op">/</span><span class="st"> </span><span class="kw">max</span>(p), </a>
<a class="sourceLine" id="cb2-10" data-line-number="10"> <span class="dt">p_smooth =</span> (<span class="kw"><a href="https://dplyr.tidyverse.org/reference/lead-lag.html">lag</a></span>(p_peak) <span class="op">+</span><span class="st"> </span>p_peak <span class="op">+</span><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/lead-lag.html">lead</a></span>(p_peak)) <span class="op">/</span><span class="st"> </span><span class="dv">3</span>,</a>
<a class="sourceLine" id="cb2-11" data-line-number="11"> <span class="dt">p_smooth =</span> <span class="kw"><a href="https://dplyr.tidyverse.org/reference/coalesce.html">coalesce</a></span>(p_smooth, p_peak)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-12" data-line-number="12"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/group_by.html">ungroup</a></span>() <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-13" data-line-number="13"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/do.html">do</a></span>({ </a>
<a class="sourceLine" id="cb2-14" data-line-number="14"> <span class="kw">rbind</span>(.,</a>
<a class="sourceLine" id="cb2-15" data-line-number="15"> <span class="kw"><a href="https://dplyr.tidyverse.org/reference/filter.html">filter</a></span>(., time <span class="op">==</span><span class="st"> </span><span class="dv">0</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-16" data-line-number="16"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">time =</span> <span class="dv">24</span><span class="op">*</span><span class="dv">60</span>))</a>
<a class="sourceLine" id="cb2-17" data-line-number="17"> }) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-18" data-line-number="18"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">time =</span> <span class="kw">ifelse</span>(time <span class="op">&lt;</span><span class="st"> </span><span class="dv">3</span> <span class="op">*</span><span class="st"> </span><span class="dv">60</span>, time <span class="op">+</span><span class="st"> </span><span class="dv">24</span> <span class="op">*</span><span class="st"> </span><span class="dv">60</span>, time)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-19" data-line-number="19"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">activity =</span> <span class="kw">reorder</span>(activity, p_peak, <span class="dt">FUN=</span>which.max)) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-20" data-line-number="20"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/arrange.html">arrange</a></span>(activity) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-21" data-line-number="21"><span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(<span class="dt">activity.f =</span> <span class="kw">reorder</span>(<span class="kw">as.character</span>(activity), <span class="kw"><a href="https://dplyr.tidyverse.org/reference/desc.html">desc</a></span>(activity))) -&gt;<span class="st"> </span>sports</a>
<a class="sourceLine" id="cb2-22" data-line-number="22"></a>
<a class="sourceLine" id="cb2-23" data-line-number="23">sports &lt;-<span class="st"> </span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/mutate.html">mutate</a></span>(sports, <span class="dt">time2 =</span> time<span class="op">/</span><span class="dv">60</span>)</a></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw">ggplot</span>(sports, <span class="kw">aes</span>(time2, p_smooth)) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/geom_horizon.html">geom_horizon</a></span>(<span class="dt">bandwidth=</span><span class="fl">0.1</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="st"> </span><span class="kw">facet_grid</span>(activity.f<span class="op">~</span>.) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="st"> </span><span class="kw">scale_x_continuous</span>(<span class="dt">expand=</span><span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">0</span>), <span class="dt">breaks=</span><span class="kw">seq</span>(<span class="dt">from =</span> <span class="dv">3</span>, <span class="dt">to =</span> <span class="dv">27</span>, <span class="dt">by =</span> <span class="dv">3</span>), <span class="dt">labels =</span> <span class="cf">function</span>(x) {<span class="kw">sprintf</span>(<span class="st">"%02d:00"</span>, <span class="kw">as.integer</span>(x <span class="op">%%</span><span class="st"> </span><span class="dv">24</span>))}) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="st"> </span>viridis<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/viridis/topics/scale_viridis">scale_fill_viridis</a></span>(<span class="dt">name =</span> <span class="st">"Activity relative to peak"</span>, <span class="dt">discrete=</span><span class="ot">TRUE</span>,</a>
<a class="sourceLine" id="cb3-6" data-line-number="6"> <span class="dt">labels=</span>scales<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/scales/topics/number_format">percent</a></span>(<span class="kw">seq</span>(<span class="dv">0</span>, <span class="dv">1</span>, <span class="fl">0.1</span>)<span class="op">+</span><span class="fl">0.1</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-7" data-line-number="7"><span class="st"> </span><span class="kw">labs</span>(<span class="dt">x=</span><span class="ot">NULL</span>, <span class="dt">y=</span><span class="ot">NULL</span>, <span class="dt">title=</span><span class="st">"Peak time of day for sports and leisure"</span>,</a>
<a class="sourceLine" id="cb3-8" data-line-number="8"> <span class="dt">subtitle=</span><span class="st">"Number of participants throughout the day compared to peak popularity.</span><span class="ch">\n</span><span class="st">Note the morning-and-evening everyday workouts, the midday hobbies,</span><span class="ch">\n</span><span class="st">and the evenings/late nights out."</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-9" data-line-number="9"><span class="st"> </span><span class="kw"><a href="http://www.rdocumentation.org/packages/hrbrthemes/topics/theme_ipsum_rc">theme_ipsum_rc</a></span>(<span class="dt">grid=</span><span class="st">""</span>) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-10" data-line-number="10"><span class="st"> </span><span class="kw">theme</span>(<span class="dt">panel.spacing.y=</span><span class="kw">unit</span>(<span class="op">-</span><span class="fl">0.05</span>, <span class="st">"lines"</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-11" data-line-number="11"><span class="st"> </span><span class="kw">theme</span>(<span class="dt">strip.text.y =</span> <span class="kw">element_text</span>(<span class="dt">hjust=</span><span class="dv">0</span>, <span class="dt">angle=</span><span class="dv">360</span>)) <span class="op">+</span></a>
<a class="sourceLine" id="cb3-12" data-line-number="12"><span class="st"> </span><span class="kw">theme</span>(<span class="dt">axis.text.y=</span><span class="kw">element_blank</span>())</a></code></pre></div>
<p><img src="horizon_files/figure-html/unnamed-chunk-3-1.png"><!-- --></p>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#horzon-charts">Horzon Charts</a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

BIN
docs/articles/horizon_files/figure-html/unnamed-chunk-3-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

193
docs/articles/index.html

@ -0,0 +1,193 @@
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Articles • ggalt</title>
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.1/clipboard.min.js" integrity="sha256-hIvIxeqhGZF+VVeM55k0mJvWpQ6gTkWk3Emc+NmowYA=" crossorigin="anonymous"></script>
<!-- sticky kit -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script>
<meta property="og:title" content="Articles" />
<!-- mathjax -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article-index">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">ggalt</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.2</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/annoticks.html">Annotation Ticks</a>
</li>
<li>
<a href="../articles/density.html">Density Plots</a>
</li>
<li>
<a href="../articles/dumbell.html">Dumbbell Charts</a>
</li>
<li>
<a href="../articles/encircling.html">Encircling Points</a>
</li>
<li>
<a href="../articles/horizon.html">Horizon Plots</a>
</li>
<li>
<a href="../articles/lollipop.html">Lollipop charts</a>
</li>
<li>
<a href="../articles/proj.html">Coord Projection</a>
</li>
<li>
<a href="../articles/spikelines.html">Spikelines</a>
</li>
<li>
<a href="../articles/splines.html">Spline Plots</a>
</li>
<li>
<a href="../articles/stateface.html">ProPublica StateFace</a>
</li>
<li>
<a href="../articles/stepribbon.html">Step Ribbons</a>
</li>
<li>
<a href="../articles/ubar.html">Uniform Bars</a>
</li>
<li>
<a href="../articles/verticaldodge.html">Vertical Dodging</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/hrbrmstr/ggalt">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Articles</h1>
</div>
<div class="section ">
<h3>All vignettes</h3>
<p class="section-desc"></p>
<ul>
<li><a href="annoticks.html">Annotation Ticks</a></li>
<li><a href="density.html">Density Plots</a></li>
<li><a href="dumbell.html">Dumbbell Charts</a></li>
<li><a href="encircling.html">Encircling Points</a></li>
<li><a href="horizon.html">Horizon Plots</a></li>
<li><a href="lollipop.html">Lollipop charts</a></li>
<li><a href="proj.html">Coord Projection</a></li>
<li><a href="spikelines.html">Spikelines</a></li>
<li><a href="splines.html">Spline Plots</a></li>
<li><a href="stateface.html">ProPublica StateFace</a></li>
<li><a href="stepribbon.html">Step Ribbons</a></li>
<li><a href="ubar.html">Uniform Bars</a></li>
<li><a href="verticaldodge.html">Vertical Dodging</a></li>
</ul>
</div>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save