I'm an happy Windows user of skimr
1.0.1. The spark graph (histogram) plot now works nicely:
> skim(mtcars)
Skim summary statistics
n obs: 32
n variables: 11
Variable type: numeric
variable missing complete n mean sd p0 p25 median p75 p100 hist
am 0 32 32 0.41 0.5 0 0 0 1 1 ▇▁▁▁▁▁▁▆
carb 0 32 32 2.81 1.62 1 2 2 4 8 ▆▇▂▇▁▁▁▁
cyl 0 32 32 6.19 1.79 4 4 6 8 8 ▆▁▁▃▁▁▁▇
disp 0 32 32 230.72 123.94 71.1 120.83 196.3 326 472 ▇▆▁▂▅▃▁▂
drat 0 32 32 3.6 0.53 2.76 3.08 3.7 3.92 4.93 ▃▇▁▅▇▂▁▁
gear 0 32 32 3.69 0.74 3 3 4 4 5 ▇▁▁▆▁▁▁▂
hp 0 32 32 146.69 68.56 52 96.5 123 180 335 ▃▇▃▅▂▃▁▁
mpg 0 32 32 20.09 6.03 10.4 15.43 19.2 22.8 33.9 ▃▇▇▇▃▂▂▂
qsec 0 32 32 17.85 1.79 14.5 16.89 17.71 18.9 22.9 ▃▂▇▆▃▃▁▁
vs 0 32 32 0.44 0.5 0 0 0 1 1 ▇▁▁▁▁▁▁▆
wt 0 32 32 3.22 0.98 1.51 2.58 3.33 3.61 5.42 ▃▃▃▇▆▁▁▂
However, when I combine skim
with R Markdown, I lose the ability to show the histograms. According to skimr
vignettes, for Markdown output I should combine skim
with kable
, with a chunk option of results='asis'
. I tried the vignette suggestion, as well as kable(skim())
without the chunk option and skim
without kable
, but none of these prints the histograms:
---
title: "test"
subtitle: "Andrea Panizza"
author: "`r Sys.Date()`"
date: "_reading time: ? minutes_"
output:
html_document:
keep_md: true
fig_caption: yes
params:
output_dir: "../output"
---
```{r setup, include=FALSE}
library(knitr)
library(skimr)
library(dplyr)
opts_chunk$set(warning = FALSE,
message = FALSE,
echo = FALSE,
fig.align = "center",
fig.width = 7.25,
fig.height = 6)
```
## test 1
```{r}
skim(mtcars)
```
## test 2
```{r}
kable(skim(mtcars))
```
## test 3
```{r, results='asis'}
kable(skim(mtcars))
```
I attach the results as images. You can also recreate them yourself by running my R Markdown example:
As you can see, I can't get the histograms. Am I doing something wrong? Should I open an issue in the skimr
repo?