-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpresentation.Rmd
119 lines (81 loc) · 1.89 KB
/
presentation.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
title: "DataTable "
author: "Michał Burdukiewicz"
date: "3 grudnia 2018"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
```
## Tabela
```{r}
ToothGrowth
```
## Tabela
```{r}
knitr::kable(ToothGrowth)
```
## DataTable
Nie mylić z data.table
```{r}
DT::datatable(ToothGrowth,
options = list(pageLength = 5))
```
## dom
Order in the document (DOM)
```{r}
DT::datatable(ToothGrowth,
options = list(pageLength = 5, dom = "rtip"))
```
## dom
Information summary
```{r}
DT::datatable(ToothGrowth,
options = list(pageLength = 5, dom = "i"))
```
## dom
Information summary
```{r}
DT::datatable(ToothGrowth,
options = list(pageLength = 5, dom = "p"))
```
## dom
Elementy można łączyć.
```{r}
DT::datatable(ToothGrowth,
options = list(pageLength = 5, dom = "ip"))
```
## dom
Elementy można łączyć (table-information-pagination).
```{r}
DT::datatable(ToothGrowth,
options = list(pageLength = 5, dom = "tip"))
```
## Extensions
```{r}
DT::datatable(ToothGrowth, extensions = "Buttons",
options = list(pageLength = 5, dom = "Btip"))
```
## Extensions
```{r}
DT::datatable(ToothGrowth, extensions = "Buttons",
options = list(pageLength = 5, dom = "Btip",
buttons = c("excel", "print")))
```
## Filtrowanie
```{r}
DT::datatable(ToothGrowth, filter = "top",
options = list(pageLength = 5))
```
## Formatowanie
```{r}
library(DT)
datatable(ToothGrowth) %>% formatStyle(
"supp", backgroundColor = styleEqual(c("VC", "OJ"),
c("yellow", "pink")))
```
## Wybieranie wierszy
dtx <- renderDataTable(datatable(..., server = TRUE)) umożliwia wykorzystywanie input[["dtx_rows_selected"]]
## Alternatywa
https://github.com/jrowen/rhandsontable