-
Notifications
You must be signed in to change notification settings - Fork 0
/
other.Rmd
executable file
·99 lines (76 loc) · 3.14 KB
/
other.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
---
title: "Other types of visualisation"
output:
html_document:
includes:
before_body: [includes/include_header.html, includes/include_header_navpage.html]
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,
warning = FALSE
)
```
# Other types of visualisation {.tabset}
There are many types of data visualisation that don't neatly fit into the other categories but are arguably extremely important and sometimes the only valid way to present your data to others in an easily consumable fashion.
## Interactive tables
Interactive tables are extremely useful for presenting data directly to your audience for them to explore, much like an Excel document. Interactivity typically includes; ability to filter individual columns, reorder columns in ascending/descending order and a filter across the entire table. Often conditional formatting is applied to tables to highlight/label data.
Required Data:
- Table of data: This data could conceivable be of any type, and include columns of multiple data types including but not limited to text, numbers, images and more
<br/>
<div class='row'>
<div class='col-md-6'>
```{r basic_barchart, echo=FALSE, message=FALSE, warning=FALSE}
library("DT")
library("tidyverse")
library("gapminder")
gapminder %>%
datatable(width = "100%",
height = "250px",
rownames = FALSE,
options = list(pageLength = 5))
```
</div>
<div class='col-md-6'>
```{r, echo=FALSE, message=FALSE, warning=FALSE, paged.print=FALSE}
library("rhandsontable")
MAT = matrix(runif(100, -1, 1), nrow = 10,
dimnames = list(LETTERS[1:10], LETTERS[1:10]))
diag(MAT) = 1
MAT[upper.tri(MAT)] = MAT[lower.tri(MAT)]
rhandsontable(MAT, readOnly = TRUE, width = "100%", height = "300px") %>%
hot_cols(renderer = "
function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.NumericRenderer.apply(this, arguments);
if (row == col) {
td.style.background = 'lightgrey';
} else if (col > row) {
td.style.background = 'grey';
td.style.color = 'grey';
} else if (value < -0.75) {
td.style.background = 'pink';
} else if (value > 0.75) {
td.style.background = 'lightgreen';
}
}")
```
</div>
</div>
## Interactive tablesdd
<!--html_preserve-->
<div class="row">
<div class="col-md-6">
<span><a href="other_interactive-tables.html">Interactive tables [tutorial]</a> are extremely useful for presenting data directly to your audience for them to explore, much like an Excel document. Interactivity typically includes; ability to filter individual columns, reorder columns in ascending/descending order and a filter across the entire table.</span>
<br>
<strong>Required Data:</strong>
<ul>
<li>Table of data: This data could conceivable be of any type, and include columns of multiple data types including but not limited to text, numbers, images and more.</li>
</ul>
</div>
<div class="col-md-6">
</div>
</div>
<!--/html_preserve-->