library(knitr)
library(skimr)
Untitled
Getting ready for fonts
Notice that the yaml at the beginning of this file includes a latex_engine which will be used when creating a pdf document.
It also includes a mainfont setting called DejaVu Sans. This is not the only font that will work to produce the spark graphs. However, it is a free font available through the extrafont
package. If you have not installed extrafont you should do so using the normal package installation procedures. You should then make sure that the desired font is installed.
The code below will not run automatically when you knit, instead you should run it in the console.
install.packages(c("extrafont"))
font_install("DejaVu Sans")
If there are any difficulties please read the extrafont documentation.
Experimenting with rendering
Try knitting this document to PDF, HTML, doc or any other format you wish to try. You will notice that there are slight differences between them. To understand the impact of the engine and font choices you should experiment with different options.
The first example shows what printing the basic skim function looks like. You can try knitting to different formats to see how it changes.
skim(iris)
Name | iris |
Number of rows | 150 |
Number of columns | 5 |
_______________________ | |
Column type frequency: | |
factor | 1 |
numeric | 4 |
________________________ | |
Group variables | None |
Variable type: factor
skim_variable | n_missing | complete_rate | ordered | n_unique | top_counts |
---|---|---|---|---|---|
Species | 0 | 1 | FALSE | 3 | set: 50, ver: 50, vir: 50 |
Variable type: numeric
skim_variable | n_missing | complete_rate | mean | sd | p0 | p25 | p50 | p75 | p100 | hist |
---|---|---|---|---|---|---|---|---|---|---|
Sepal.Length | 0 | 1 | 5.84 | 0.83 | 4.3 | 5.1 | 5.80 | 6.4 | 7.9 | ▆▇▇▅▂ |
Sepal.Width | 0 | 1 | 3.06 | 0.44 | 2.0 | 2.8 | 3.00 | 3.3 | 4.4 | ▁▆▇▂▁ |
Petal.Length | 0 | 1 | 3.76 | 1.77 | 1.0 | 1.6 | 4.35 | 5.1 | 6.9 | ▇▁▆▇▂ |
Petal.Width | 0 | 1 | 1.20 | 0.76 | 0.1 | 0.3 | 1.30 | 1.8 | 2.5 | ▇▁▇▅▃ |
It is possible that the histograms will not print in all of the formats.
Unfortunately this is outside the control of the skimr team because it relates to the operating system you are using, fonts installed, and locale.