-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
73 lines (55 loc) · 1.93 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
---
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%"
)
```
# Welcome to vthemes!
<!-- badges: start -->
<!-- badges: end -->
`vthemes` provides convenient utility functions as well as a clean and modern theme for `ggplot2` plots and R Markdown documents.
## Installation
You can install the development version of vthemes from [GitHub](https://github.com/) with:
``` r
devtools::install_github("Yu-Group/vthemes")
```
## Example Usage
```{r}
library(vthemes)
library(ggplot2)
```
### The `vmodern` ggplot Theme
The `vmodern` ggplot theme provides a minimalistic but modern style to `ggplot2` plots with discrete and continuous color schemes that are heavily built around `viridis` and the "Dark2" palette from `RColorBrewer`.
```{r ggplot-example-1, fig.width = 8, fig.height = 4}
ggplot(iris) +
aes(x = Sepal.Length, fill = Species) +
geom_density(alpha = 0.4) +
theme_vmodern() +
scale_fill_vmodern(discrete = TRUE)
```
```{r ggplot-example-2, fig.width = 8, fig.height = 4}
ggplot(iris) +
aes(x = Sepal.Length, y = Sepal.Width, color = Petal.Length) +
facet_wrap(~ Species) +
geom_point() +
theme_vmodern() +
scale_color_vmodern(discrete = FALSE)
```
### The `vmodern` R Markdown Theme
The `vmodern` R Markdown theme is largely based upon the material design theme from the `rmdformats` R package but has been adapted to maximize the content spacing, improve tab functionality, and utilize a different color scheme. To use the `vmodern` theme, set `output: vthemes::vmodern` in the R Markdown yaml header as follows:
``` yml
---
title: Document Title
author: Tiffany Tang
date: `r format(Sys.time(), '%B %d, %Y')`
output:
vthemes::vmodern
---
```
[![vmodern example](man/figures/vmodern.png)](https://yu-group.github.io/vthemes/vmodern.html)