-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
51 lines (39 loc) · 1.19 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
---
output:
github_document:
html_preview: true
toc: true
fig_width: 8
fig_height: 8
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
[![Travis-CI Build Status](https://travis-ci.org/wilkox/ggwrap.svg?branch=master)](https://travis-ci.org/wilkox/ggwrap)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/ggwrap)](https://cran.r-project.org/package=ggwrap)
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
'ggwrap' wraps a 'ggplot2' plot over multiple rows, to make plots with long x axes easier to read.
# Installation
The development version of 'ggwrap' can be installed from GitHub:
```{r eval = F}
devtools::install_github("wilkox/ggwrap")
```
# Usage
The `ggwrap` function takes two arguments: a 'ggplot2' plot, and the number of
rows over which the plot should be wrapped.
Here's a simple plot.
```{r}
library(ggplot2)
library(ggwrap)
plot <- ggplot(economics, aes(x = date, y = unemploy, colour = uempmed)) +
geom_line()
plot
```
We can use `ggwrap` to wrap the plot over four rows.
```{r}
ggwrap(plot, 4)
```