| 1 |
--- |
| 2 |
title: "Untitled" |
| 3 |
mainfont: DejaVu Sans |
| 4 |
output: |
| 5 |
html_document: default |
| 6 |
pdf_document: |
| 7 |
latex_engine: xelatex |
| 8 |
word_document: default |
| 9 |
font-family: Times New Roman |
| 10 |
--- |
| 11 |
|
| 12 |
## Getting ready for fonts |
| 13 |
|
| 14 |
Notice that the yaml at the beginning of this file includes a latex_engine which will be used |
| 15 |
when creating a pdf document. |
| 16 |
|
| 17 |
It also includes a mainfont setting called _DejaVu Sans_. This is not the only font that will |
| 18 |
work to produce the spark graphs. However, it is a free font available through the |
| 19 |
`extrafont` package. If you have not installed extrafont you should do so using the normal |
| 20 |
package installation procedures. You should then make sure that the desired font is installed. |
| 21 |
|
| 22 |
The code below will not run automatically when you knit, instead you should run it in the |
| 23 |
console. |
| 24 |
|
| 25 |
``` |
| 26 |
install.packages(c("extrafont")) |
| 27 |
font_install("DejaVu Sans") |
| 28 |
``` |
| 29 |
|
| 30 |
If there are any difficulties please read the extrafont documentation. |
| 31 |
|
| 32 |
## Experimenting with rendering |
| 33 |
|
| 34 |
```{r, message=FALSE} |
| 35 |
library(knitr) |
| 36 |
library(skimr) |
| 37 |
``` |
| 38 |
|
| 39 |
Try knitting this document to PDF, HTML, doc or any other format you wish to try. You |
| 40 |
will notice that there are slight differences between them. To understand the impact |
| 41 |
of the engine and font choices you should experiment with different options. |
| 42 |
|
| 43 |
The first example shows what printing the basic skim function looks like. |
| 44 |
You can try knitting to different formats to see how it changes. |
| 45 |
|
| 46 |
```{r } |
| 47 |
skim(iris) |
| 48 |
``` |
| 49 |
|
| 50 |
It is possible that the histograms will not print in all of the formats. |
| 51 |
|
| 52 |
Unfortunately this is outside the control of the skimr team because |
| 53 |
it relates to the operating system you are using, fonts installed, |
| 54 |
and locale. |
| 55 |
|