-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshiny.Rmd
89 lines (60 loc) · 1.42 KB
/
shiny.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
title: "flextable package"
subtitle: "part compose example"
date: "`r Sys.Date()`"
output:
xaringan::moon_reader:
css: ['default', 'static/ardata-remark.css']
---
---
## flextable in Shiny
.marker-writting[
Show a flextable in a Shiny application : too easy !
]
.row[
.col-xs-6[
<pre class = "nomtop nombottom">
<code class="r remark-code">library(shiny)
library(flextable)
datasets <- c("iris", "mtcars", "airquality",
"quakes", "CO2", "rock", "sleep")
ui <- fluidPage(
titlePanel("Show a flextable in Shiny application"),
sidebarLayout(
sidebarPanel(
selectInput("SI_dataset",
label = "Choose dataset", choices = datasets)
),
mainPanel(
<strong>uiOutput</strong>("dataset_flextable")
)
)
)
server <- function(input, output) {
output$<strong>dataset_flextable</strong> <- <strong>renderUI</strong>({
req(input$SI_dataset)
get(input$SI_dataset) %>%
head(n = 10) %>%
flextable() %>%
theme_booktabs() %>%
<strong>htmltools_value</strong>()
})
}
shinyApp(ui = ui, server = server)
</code></pre>
]
.col-xs-6[

]
]
---
</br></br></br></br></br></br>
<img src = "./static/img/dontlikecoding.gif" class = "img_center"/>
---
</br></br></br></br></br></br>
<img src = "./static/img/fall_asleep.gif" class = "img_center"/>
---
## flextableUI
---
## flextableUI
