Skip to content

Commit

Permalink
add pkgdown build
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Jan 4, 2019
1 parent 4c88018 commit 62128b9
Show file tree
Hide file tree
Showing 68 changed files with 4,307 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^docs$
^_pkgdown\.yml$
^data-raw$
^.*\.Rproj$
^\.Rproj\.user$
Expand Down
22 changes: 11 additions & 11 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ knitr::opts_chunk$set(

# ungeviz

Tools for visualizing uncertainty with ggplot2, written by Claus O. Wilke
Tools for visualizing uncertainty with ggplot2.

This package is meant to provide helpful add-on functionality for ggplot2 to
visualize uncertainty. The package is particularly focused on hypothetical
Expand Down Expand Up @@ -51,27 +51,26 @@ cacao %>% filter(location %in% c("Canada", "U.S.A.")) %>%
transition_states(.draw, 1, 3)
```

Both the bootstrapper and sampler objects can be used for repeated reproducible sampling, by passing the sampe bootstrapper or sampler object as data to multiple ggplot2 layers.
Both the bootstrapper and sampler objects can be used for repeated reproducible sampling, by passing the same bootstrapper or sampler object as data to multiple ggplot2 layers.

```{r bluejays-lm-anim, fig.asp = 0.5}
data(BlueJays, package = "Stat2Data")
# set up bootstrapping object that generates 20 bootstraps
# and groups by variable `KnownSex`
bs <- bootstrapper(20, KnownSex)
bsr <- bootstrapper(20, KnownSex)
ggplot(BlueJays, aes(BillLength, Head, color = KnownSex)) +
geom_smooth(method = "lm", color = NA) +
geom_point(alpha = 0.3) +
# `.row` is a generated column providing a unique row number for all rows
geom_point(data = bs, aes(group = .row)) +
geom_smooth(data = bs, method = "lm", fullrange = TRUE, se = FALSE) +
geom_point(data = bsr, aes(group = .row)) +
geom_smooth(data = bsr, method = "lm", fullrange = TRUE, se = FALSE) +
facet_wrap(~KnownSex, scales = "free_x") +
scale_color_manual(values = c(F = "#D55E00", M = "#0072B2"), guide = "none") +
theme_bw() +
transition_states(.draw, 1, 1) +
enter_fade() +
exit_fade()
enter_fade() + exit_fade()
```

## Smooth draws {#smooth-draws}
Expand All @@ -81,15 +80,16 @@ Instead of bootstrapping smoothers or regression lines, we can also fit a smooth
```{r mtcars-smooth-anim}
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
stat_smooth_draws(times = 20) +
stat_smooth_draws(times = 20, aes(group = stat(.draw))) +
theme_bw() +
transition_states(stat(.draw), 1, 2)
transition_states(stat(.draw), 1, 2) +
enter_fade() + exit_fade()
```


## Confidence strips {#confidence-strips}
## Miscellaneous geoms and stats {#geoms-stats}

The ungeviz package provides a convenient way of drawing confidence strips, via `stat_confidence_density()`.
Several geoms and stats are provided that can be helpful when visualizing uncertainty, including `geom_hpline()` and `geom_vpline()` used in the sampling example above, and `stat_confidence_density()` which can draw confidence strips.

```{r cacao-means}
library(broom)
Expand Down
30 changes: 30 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
destination: docs

reference:
- title: Sampling and bootstrapping
desc: Reliable sampling from and bootstrapping of data frames
contents:
- bootstrapper
- sampler

- title: Posterior draws
desc: Posterior draws of GAM fits
contents:
- stat_smooth_draws
- sample_outcomes
- confidence_band

- title: Geoms
desc: Miscellaneous ggplot2 geoms
contents:
- starts_with("geom_")

- title: Stats
desc: Miscellaneous ggplot2 stats
contents:
- starts_with("stat_")

- title: Data sets
desc: Demo data sets provided with the package
contents:
- cacao
Empty file added docs/.nojekyll
Empty file.
149 changes: 149 additions & 0 deletions docs/ISSUE_TEMPLATE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

148 changes: 148 additions & 0 deletions docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 62128b9

Please sign in to comment.