Quarto edits (#1355)
* Remove dashboards * Fix typos, make table legible * Remove trailing slash
This commit is contained in:
committed by
GitHub
parent
ac74f985a5
commit
8cb1037e1e
@@ -43,5 +43,3 @@ superscript^2^ subscript~2~
|
||||
|--------------|---------------|
|
||||
| Content Cell | Content Cell |
|
||||
| Content Cell | Content Cell |
|
||||
|
||||
/
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 335 KiB |
@@ -1,63 +0,0 @@
|
||||
---
|
||||
title: "💍 Diamonds dashboard"
|
||||
format: html
|
||||
execute:
|
||||
echo: false
|
||||
---
|
||||
|
||||
```{r}
|
||||
#| label: setup
|
||||
#| include: false
|
||||
|
||||
library(tidyverse)
|
||||
library(gt)
|
||||
```
|
||||
|
||||
::: panel-tabset
|
||||
## Plots
|
||||
|
||||
```{r}
|
||||
#| layout: [[30,-5, 30, -5, 30], [100]]
|
||||
|
||||
ggplot(diamonds, aes(x = carat)) + geom_histogram(binwidth = 0.1)
|
||||
ggplot(diamonds, aes(x = price)) + geom_histogram(binwidth = 500)
|
||||
ggplot(diamonds, aes(x = cut, color = cut)) + geom_bar()
|
||||
|
||||
ggplot(diamonds, aes(x = carat, y = price, color = cut)) + geom_point()
|
||||
```
|
||||
|
||||
## Summaries
|
||||
|
||||
```{r}
|
||||
diamonds |>
|
||||
select(price, carat, cut) |>
|
||||
group_by(cut) |>
|
||||
summarize(
|
||||
across(where(is.numeric), list(mean = mean, median = median, sd = sd, IQR = IQR))
|
||||
) |>
|
||||
pivot_longer(cols = -cut) |>
|
||||
pivot_wider(names_from = cut, values_from = value) |>
|
||||
separate(name, into = c("var", "stat")) |>
|
||||
mutate(
|
||||
var = str_to_title(var),
|
||||
stat = str_to_title(stat),
|
||||
stat = if_else(stat == "Iqr", "IQR", stat)
|
||||
) |>
|
||||
group_by(var) |>
|
||||
gt() |>
|
||||
fmt_currency(columns = -stat, rows = 1:4, decimals = 0) |>
|
||||
fmt_number(columns = -stat, rows = 5:8,) |>
|
||||
cols_align(columns = -stat, align = "center") |>
|
||||
cols_label(stat = "")
|
||||
```
|
||||
|
||||
## Data
|
||||
|
||||
```{r}
|
||||
diamonds |>
|
||||
arrange(desc(carat)) |>
|
||||
slice_head(n = 100) |>
|
||||
select(price, carat, cut) |>
|
||||
DT::datatable()
|
||||
```
|
||||
:::
|
||||
Binary file not shown.
Reference in New Issue
Block a user