-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
146 lines (87 loc) · 2.71 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
library(ragg)
ragg_png = function(..., res = 400) {
ragg::agg_png(..., res = res, units = "in")
}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
fig.ext = "png",
dev = "ragg_png",
out.width = "100%",
warning = FALSE
)
library(ggplot2, quietly = T)
```
# dntheme
<!-- badges: start -->
[![R-CMD-check](https://github.com/Data-Network-Lab/DN_theme/workflows/R-CMD-check/badge.svg)](https://github.com/Data-Network-Lab/DN_theme/actions)
<!-- badges: end -->
This repo contains the functions of the `dntheme` package, which once installed locally, provides helpful functions for creating and exporting graphics made in ggplot in the style used by the Data Network associates & projects.
## Installation 🔨
`dntheme` is not on CRAN, so you will have to install it directly from Github using devtools.
You can install the development version from [GitHub](https://github.com/) with:
``` {r, eval=FALSE}
install.packages("devtools")
devtools::install_github("Data-Network-Lab/dntheme")
```
## Use `dntheme` 💊
The package automagically 🧙 imports (via `showtext`) the **Raleway** Google font ([Raleway, sans-serif](https://fonts.google.com/specimen/Raleway))
```{r}
library(dntheme)
d <- qplot(carat, data = diamonds[diamonds$color %in%LETTERS[4:7], ], geom = "histogram", bins=30, fill = color)
d
```
Tech themes and scales:
```{r}
d + theme_dn() +
scale_fill_dn() +
labs(title="Data Network theme",
subtitle="the latest build of this README was 27/09/2021")
```
Data Network color scales:
```{r}
data("iris")
d1 <- qplot(x = Sepal.Length, y =Sepal.Width,colour = Species,data = iris,geom = "point")
d1
```
```{r}
r = d1 + theme_dn() +
scale_color_dn() +
labs(title="Data Network theme tooo!",
subtitle="wow, iris species are so popular")
```
DN_geoms, inspired by [emoGG](https://github.com/dill/emoGG).
```{r}
d2 <- data.frame(x = c(1:4, 3:1), y=1:7)
```
```{r}
plot = ggplot(aes(x,y), data=d2) +
geom_dn(size=1.5, theme="google") +
theme_dn() +
labs(
x = "",
y = "")
add_dn_titles(
plot,
title = "Let's have this logos up here",
subtitle = "they look fun")
```
<!-- ```{r, eval=FALSE} -->
<!-- ggplot(aes(x,y), data=d2) + -->
<!-- geom_tech(size=0.15, theme="etsy") + -->
<!-- theme_tech("etsy")+ -->
<!-- ggtitle("Etsy geom") -->
<!-- ``` -->
## Data Network Palette 🌈
![dn_palette](man/figures/palette.png)
## License
[(Back to top)](#table-of-contents)
Please visit the LICENSE.md file.
<!-- Add the footer here -->
![Footer](man/figures/footer.png)