44 lines
656 B
Plaintext
44 lines
656 B
Plaintext
|
---
|
||
|
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()
|
||
|
```
|