Skip to content

Instantly share code, notes, and snippets.

@MySchizoBuddy
Created June 5, 2016 10:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save MySchizoBuddy/ad1a1fc057be9d9e65c4d997204debb7 to your computer and use it in GitHub Desktop.
Testing different table rendering engines
---
title: "Testing different table rendering engines"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(DT)
library(dplyr)
library(rhandsontable)
values <- reactiveValues(data = data.frame(x = c(1,2), y = c("A", "B")))
```
Inputs {.sidebar}
-------------------------------------
```{r sidebar}
br()
actionButton("addRow", "Add row to data")
observeEvent(input$addRow, {
values$data <- bind_rows(values$data, data.frame(x = 2, y = "BBBBBBBBBBBBBB"))
})
```
Column
-----------------------------------------------------------------------
### Table A
```{r}
renderTable(values$data)
```
### Table B
```{r}
DT::renderDataTable(values$data, server = FALSE, rownames = FALSE, style = "bootstrap" )
```
Column
-----------------------------------------------------------------------
### Table C
```{r}
p("rhandsontable doesn't show here")
rHandsontableOutput("TableC")
output$TableC <- renderRHandsontable({values$data})
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment