-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
93 lines (74 loc) · 2.88 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
fig.show = "hide",
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ggwebthemes
<!-- badges: start -->
<!-- badges: end -->
This R package contains some themes for <font size="4">``ggplot2``</font> that were optimized for use in blogs and for similar online usage. Package source code is available [on GitLab](https://gitlab.com/peterbar/ggwebthemes). You can find a post about this package on [Data Enthusiast's Blog](https://dataenthusiast.ca/).
Note: the package repository is also mirrorred to GitHub, primarily in order for <font size="4">``available::available("ggwebthemes")``</font> to show that the package name was taken; <font size="4">``ggwebthemes``</font> home is on GitLab.
Submit bug reports, issues, and feature requests [here](https://gitlab.com/peterbar/ggwebthemes/-/issues).
## Installation
The package is not yet on CRAN. You can install <font size="4">``ggwebthemes``</font> from GitLab:
``` r
# option 1: install using devtools
devtools::install_gitlab("peterbar/ggwebthemes")
# option 2: install using remotes
remotes::install_gitlab("peterbar/ggwebthemes")
```
## Examples
```{r example}
library(ggwebthemes)
library(palmerpenguins)
# theme_web_bw()
ggplot(penguins, aes(x = bill_length_mm, y = body_mass_g)) +
facet_wrap(~ species, scales = "free_x") +
geom_point(size = 2, na.rm = TRUE) +
geom_smooth(formula = y ~ x,
method = "lm",
se = FALSE,
na.rm = TRUE) +
theme_web_bw() +
labs(x = "Bill length, mm",
y = "Body mass, grams",
title = "Body Mass vs. Bill Length in Penguins",
subtitle = "Grouped by Species",
caption = "Data: Gorman, Williams, and Fraser 2014")
# theme_web_classic()
ggplot(penguins, aes(x = bill_length_mm, y = body_mass_g)) +
facet_wrap(~ species, scales = "free_x") +
geom_point(size = 2, na.rm = TRUE) +
geom_smooth(formula = y ~ x,
method = "lm",
se = FALSE,
na.rm = TRUE) +
theme_web_classic() +
labs(x = "Bill length, mm",
y = "Body mass, grams",
title = "Body Mass vs. Bill Length in Penguins",
subtitle = "Grouped by Species",
caption = "Data: Gorman, Williams, and Fraser 2014")
# theme_web_void()
ggplot(penguins, aes(x = bill_length_mm, y = body_mass_g)) +
facet_wrap(~ species, scales = "free_x") +
geom_point(size = 2, na.rm = TRUE) +
geom_smooth(formula = y ~ x,
method = "lm",
se = FALSE,
na.rm = TRUE) +
theme_web_void() +
labs(x = "Bill length, mm",
y = "Body mass, grams",
title = "Body Mass vs. Bill Length in Penguins",
subtitle = "Grouped by Species",
caption = "Data: Gorman, Williams, and Fraser 2014")
```