Skip to content

Instantly share code, notes, and snippets.

@juba
Created September 19, 2017 12:26
Show Gist options
  • Save juba/cfe14111ed7bf688578d0620b2193e73 to your computer and use it in GitHub Desktop.
Save juba/cfe14111ed7bf688578d0620b2193e73 to your computer and use it in GitHub Desktop.
Tris à plat Rmarkdown
---
title: "test"
date: "19 septembre 2017"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(knitr)
library(questionr)
d <- data.frame(question1 = c("a","a","b"), question2 = c("d","d","e"))
```
# Tris à plat
```{r, results='asis'}
for (var in names(d)) {
cat('## ', var, '\n')
cat(kable(freq(d[,var]), format='markdown'), sep = '\n')
cat('\n')
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment