-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.Rmd
105 lines (74 loc) · 2.12 KB
/
index.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
---
title: "Davut: Advanced Dashboard"
output:
flexdashboard::flex_dashboard:
orientation: row #rows #columns
vertical_layout: fill #scroll #fill
social: ["menu"]
source_code: embed
theme:
version: 4
bootswatch: slate
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse, warn.conflicts = F)
library(palmerpenguins) # data source
library(plotly)
library(DT)
library(fontawesome)
data("penguins")
```
Plots {data-navmenu="Pages"}
=======================================================================
sidebar {.sidebar}
-----------------------------------------------------------------------
### Penguin Stats
The number of penguins in the data is `r nrow(penguins)`
Row
-----------------------------------------------------------------------
### Number of penguins
```{r}
valueBox(nrow(penguins), icon = "fa-linux")
```
### Avg body mass
```{r}
avg_mass = round(mean(penguins$body_mass_g, na.rm=T), 1)
gauge(avg_mass, min = 0, max = max(penguins$body_mass_g, na.rm = T),
gaugeSectors(success = c(4000, 6300),
warning = c(2000, 3999),
danger = c(0, 1999)))
```
Column {.tabset}
-----------------------------------------------------------------------
### Scatter Plot
```{r, warning=FALSE}
a =
penguins %>%
ggplot(aes(x = bill_length_mm, y = bill_depth_mm, color = species)) +
geom_point()
ggplotly(a)
# htmlwidgets for r
```
### Chart B
```{r, warning=FALSE}
penguins %>%
ggplot(aes(x = body_mass_g, y = sex, fill = sex)) +
geom_boxplot()
```
### Chart C
```{r, warning=FALSE}
penguins %>%
ggplot(aes(x = flipper_length_mm, fill = species)) +
geom_histogram() +
facet_wrap(~species)
```
Data {data-navmenu="Pages"}
=========================================================================
```{r}
penguins %>%
datatable(extensions = "Buttons", options = list(dom = "Blfrtip",
buttons = c("copy", "csv",
"excel", "pdf",
"print")))
```