Skip to content

Instantly share code, notes, and snippets.

@Athospd
Created November 5, 2014 23:53
Show Gist options
  • Save Athospd/1c01e67ff077b894db24 to your computer and use it in GitHub Desktop.
Save Athospd/1c01e67ff077b894db24 to your computer and use it in GitHub Desktop.
Exemplo de tabela condensada com pander em RMarkdown
---
title: "Exemplo Tabelas com Pander em RMarkdown"
author: "Athos"
date: "Wednesday, November 05, 2014"
output: html_document
---
```{r}
library(pander)
library(magrittr)
panderOptions('table.style', 'rmarkdown')
matriz_larga <- matrix(c(TRUE, FALSE), 10, 20) %>% as.data.frame.matrix
```
# Tabela cortada
```{r, results='asis'}
matriz_larga %>% pander
```
# Tabela condensada
```{r, results='asis'}
panderOptions('table.split.table', Inf)
matriz_larga %>% pander
```
OBS: para o pander funcionar, o parâmetro `results` do chunk precisa ser `asis`. Exemplo: `'''{r, results = "asis"} `
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment