ZIWAUA0/KursR/Rodział 6/flexdashboard_example.Rmd

44 lines
656 B
Plaintext
Raw Normal View History

2020-04-17 20:10:04 +02:00
---
title: "Rozkład danych diamentów"
output: flexdashboard::flex_dashboard
---
```{r setup, include = FALSE}
library(DT)
library(ggplot2)
library(dplyr)
knitr::opts_chunk$set(fig.width = 5, fig.asp = 1/3)
```
## Kolumna 1
### Karaty (zmienna carat)
```{r}
ggplot(diamonds, aes(carat)) + geom_histogram(binwidth = 0.1)
```
### Szlif (zmienna cut)
```{r}
ggplot(diamonds, aes(cut)) + geom_bar()
```
### Kolor (zmienna color)
```{r}
ggplot(diamonds, aes(color)) + geom_bar()
```
## Kolumna 2
### Największe diamenty
```{r}
diamonds %>%
arrange(desc(carat)) %>%
head(100) %>%
select(carat, cut, color, price) %>%
DT::datatable()
```