-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
58 lines (43 loc) · 1.86 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dev = "ragg_png",
dpi = 144
)
```
# ggragged <a href="https://mikmart.github.io/ggragged/"><img src="man/figures/logo.png" align="right" height="139" /></a>
<!-- badges: start -->
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
[](https://github.com/mikmart/ggragged/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/mikmart/ggragged?branch=main)
[](https://CRAN.R-project.org/package=ggragged)
<!-- badges: end -->
ggragged extends the faceting system in [ggplot2](https://ggplot2.tidyverse.org/)
to ragged grids---a hybrid layout between `facet_wrap()` and `facet_grid()`.
- `facet_ragged_rows()` groups panels into rows that can vary in length.
- `facet_ragged_cols()` groups panels into columns that can vary in length.
## Installation
Install the current release from [CRAN](https://cran.r-project.org/package=ggragged):
``` r
install.packages("ggragged")
```
Or the development version from [GitHub](https://github.com/mikmart/ggragged):
``` r
remotes::install_github("mikmart/ggragged")
```
## Example
Ragged grids can be used to clearly separate nested hierarchies in the panel layout:
```{r example}
library(ggplot2)
library(ggragged)
p <- ggplot(mpg, aes(displ, cty)) + geom_point()
p + facet_ragged_rows(vars(drv), vars(cyl))
p + facet_ragged_cols(vars(cyl), vars(drv))
```