Skip to content

Commit 0fe6709

Browse files
authored
Merge pull request #92 from ivelasq/master
edit readme
2 parents 11b3c37 + d8d060e commit 0fe6709

File tree

7 files changed

+26
-15
lines changed

7 files changed

+26
-15
lines changed

R/font_dataedu.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ cabinproto <- proto::proto(expr={
2222
setwd(wd)
2323
stop("font doesn't exist...")
2424
}
25-
sysfonts::font_add(sub("\\..*", "", font), font)
25+
sysfonts::font_add(family = sub("\\..*", "", font),
26+
regular = font)
2627
showtext::showtext_auto()
2728
setwd(wd)
2829
}

R/theme_dataedu.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#' theme_dataedu()
88
#'
99
#' @details
10-
#' The dataedu theme uses the font Gills Sans Mt.
10+
#' The dataedu theme uses the font Cabin.
1111
#'
1212
#' @rdname theme_dataedu
1313
#' @export

README.Rmd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dep <- as.vector(read.dcf('DESCRIPTION')[, 'Depends'])
1818

1919
<!-- badges: start -->
2020
[![Travis build status](https://travis-ci.org/data-edu/dataedu.svg?branch=master)](https://travis-ci.org/data-edu/dataedu)
21-
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/data-edu/dataedu?branch=master&svg=true)](https://ci.appveyor.com/project/data-edu/dataedu)
21+
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/ivelasq/dataedu?branch=master&svg=true)](https://ci.appveyor.com/project/ivelasq/dataedu)
2222
[![Codecov test coverage](https://codecov.io/gh/data-edu/dataedu/branch/master/graph/badge.svg)](https://codecov.io/gh/data-edu/dataedu?branch=master)
2323
[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.6-6666ff.svg)](https://cran.r-project.org/)
2424
[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](https://github.com/data-edu/dataedu/commits/master)
@@ -117,7 +117,9 @@ If you would like to download the data in non-`.Rds` (RData) format, the CSV and
117117

118118
Add the theme and palette to ggplot2-based plots using `theme_dataedu()` and `scale_*_dataedu()`.
119119

120-
```{r, fig.align = "center", dpi = 300, message = FALSE, warning = FALSE}
120+
* **Note:** The DataEdu theme uses {showtext} to render the font. If you would like to use it in an R markdown chunk, please ensure that the chunk lists `fig.showtext = TRUE`. If you would like to use it in a standalone R script, then you will need to use a differnet graphic device. More information is available in the documentation [here](https://cran.rstudio.com/web/packages/showtext/vignettes/introduction.html).
121+
122+
```{r, fig.align = "center", dpi = 300, message = FALSE, warning = FALSE, fig.showtext = TRUE}
121123
library(ggplot2)
122124
library(dataedu)
123125
@@ -127,7 +129,7 @@ ggplot(midwest, aes(x = area, y = popdensity, color = state)) +
127129
scale_color_dataedu()
128130
```
129131

130-
The font for the DSIEUR graphs is Gill Sans MT and available [here](https://www.dafontfree.net/freefonts-gill-sans-mt-f64845.htm). The code to load the font with the package is heavily based on the code from Guangchuang Yu's [extrafont](https://github.com/GuangchuangYu/emojifont) package - thank you!
132+
The font for the DSIEUR graphs is Cabin and available [here](https://fonts.google.com/specimen/Cabin). The code to load the font with the package is heavily based on the code from Guangchuang Yu's [extrafont](https://github.com/GuangchuangYu/emojifont) package - thank you!
131133

132134
## Contact
133135

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
[![Travis build
99
status](https://travis-ci.org/data-edu/dataedu.svg?branch=master)](https://travis-ci.org/data-edu/dataedu)
1010
[![AppVeyor build
11-
status](https://ci.appveyor.com/api/projects/status/github/data-edu/dataedu?branch=master&svg=true)](https://ci.appveyor.com/project/data-edu/dataedu)
11+
status](https://ci.appveyor.com/api/projects/status/github/ivelasq/dataedu?branch=master&svg=true)](https://ci.appveyor.com/project/ivelasq/dataedu)
1212
[![Codecov test
1313
coverage](https://codecov.io/gh/data-edu/dataedu/branch/master/graph/badge.svg)](https://codecov.io/gh/data-edu/dataedu?branch=master)
1414
[![minimal R
1515
version](https://img.shields.io/badge/R%3E%3D-3.6-6666ff.svg)](https://cran.r-project.org/)
16-
[![Last-changedate](https://img.shields.io/badge/last%20change-2020--05--29-yellowgreen.svg)](https://github.com/data-edu/dataedu/commits/master)
16+
[![Last-changedate](https://img.shields.io/badge/last%20change-2020--05--31-yellowgreen.svg)](https://github.com/data-edu/dataedu/commits/master)
1717
<!-- badges: end -->
1818

1919
The goal of {dataedu} is to provide readers of [Data Science in
@@ -108,9 +108,9 @@ To see the packages used in the book, run:
108108
``` r
109109
dataedu::dataedu_packages
110110
#> [1] "apaTables" "caret" "dummies" "ggraph" "here"
111-
#> [6] "janitor" "lme4" "lubridate" "performance" "readxl"
112-
#> [11] "rtweet" "randomNames" "sjPlot" "textdata" "tidygraph"
113-
#> [16] "tidylog" "tidyverse" "tidytext"
111+
#> [6] "janitor" "lme4" "lubridate" "performance" "ranger"
112+
#> [11] "readxl" "rtweet" "randomNames" "sjPlot" "textdata"
113+
#> [16] "tidygraph" "tidylog" "tidyverse" "tidytext"
114114
```
115115

116116
**A special note on {tabulizer}:** One of the walkthroughs uses
@@ -195,6 +195,15 @@ file would be.
195195
Add the theme and palette to ggplot2-based plots using `theme_dataedu()`
196196
and `scale_*_dataedu()`.
197197

198+
- **Note:** The DataEdu theme uses {showtext} to render the font. If
199+
you would like to use it in an R markdown chunk, please ensure that
200+
the chunk lists `fig.showtext = TRUE`. If you would like to use it
201+
in a standalone R script, then you will need to use a differnet
202+
graphic device. More information is available in the documentation
203+
[here](https://cran.rstudio.com/web/packages/showtext/vignettes/introduction.html).
204+
205+
<!-- end list -->
206+
198207
``` r
199208
library(ggplot2)
200209
library(dataedu)
@@ -207,10 +216,9 @@ ggplot(midwest, aes(x = area, y = popdensity, color = state)) +
207216

208217
<img src="man/figures/README-unnamed-chunk-5-1.png" style="display: block; margin: auto;" />
209218

210-
The font for the DSIEUR graphs is Gill Sans MT and available
211-
[here](https://www.dafontfree.net/freefonts-gill-sans-mt-f64845.htm).
212-
The code to load the font with the package is heavily based on the code
213-
from Guangchuang Yu’s
219+
The font for the DSIEUR graphs is Cabin and available
220+
[here](https://fonts.google.com/specimen/Cabin). The code to load the
221+
font with the package is heavily based on the code from Guangchuang Yu’s
214222
[extrafont](https://github.com/GuangchuangYu/emojifont) package - thank
215223
you\!
216224

13.6 KB
Loading
175 KB
Loading

man/theme_dataedu.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)