Communicate wrap up (#1136)
* Workflow update * Edit Quarto formats * Finish edits to formats + move quarto pngs * Update intro + fix typos * Update status
This commit is contained in:
committed by
GitHub
parent
9b592e7680
commit
7ff2b15021
@@ -1,42 +0,0 @@
|
||||
---
|
||||
title: "Diamonds distribution dashboard"
|
||||
output: flexdashboard::flex_dashboard
|
||||
---
|
||||
|
||||
```{r setup, include = FALSE}
|
||||
library(ggplot2)
|
||||
library(dplyr)
|
||||
knitr::opts_chunk$set(fig.width = 5, fig.asp = 1/3)
|
||||
```
|
||||
|
||||
## Column 1
|
||||
|
||||
### Carat
|
||||
|
||||
```{r}
|
||||
ggplot(diamonds, aes(carat)) + geom_histogram(binwidth = 0.1)
|
||||
```
|
||||
|
||||
### Cut
|
||||
|
||||
```{r}
|
||||
ggplot(diamonds, aes(cut)) + geom_bar()
|
||||
```
|
||||
|
||||
### Colour
|
||||
|
||||
```{r}
|
||||
ggplot(diamonds, aes(color)) + geom_bar()
|
||||
```
|
||||
|
||||
## Column 2
|
||||
|
||||
### The largest diamonds
|
||||
|
||||
```{r}
|
||||
diamonds |>
|
||||
arrange(desc(carat)) |>
|
||||
head(100) |>
|
||||
select(carat, cut, color, price) |>
|
||||
DT::datatable()
|
||||
```
|
||||
17
quarto/example-book.yml
Normal file
17
quarto/example-book.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
project:
|
||||
type: book
|
||||
|
||||
book:
|
||||
title: "A book on color scales"
|
||||
author: "Jane Coloriste"
|
||||
chapters:
|
||||
- index.qmd
|
||||
- intro.qmd
|
||||
- viridis-colors.qmd
|
||||
- terrain-colors.qmd
|
||||
|
||||
format:
|
||||
html:
|
||||
theme: cosmo
|
||||
pdf: default
|
||||
epub: default
|
||||
@@ -1,10 +1,13 @@
|
||||
name: "my-website"
|
||||
navbar:
|
||||
title: "My Website"
|
||||
left:
|
||||
- text: "Home"
|
||||
href: index.html
|
||||
- text: "Viridis Colors"
|
||||
href: 1-example.html
|
||||
- text: "Terrain Colors"
|
||||
href: 3-inline.html
|
||||
project:
|
||||
type: website
|
||||
|
||||
website:
|
||||
title: "A website on color scales"
|
||||
navbar:
|
||||
left:
|
||||
- href: index.qmd
|
||||
text: Home
|
||||
- href: viridis-colors.qmd
|
||||
text: Viridis colors
|
||||
- href: terrain-colors.qmd
|
||||
text: Terrain colors
|
||||
|
||||
BIN
quarto/quarto-dashboard.png
Normal file
BIN
quarto/quarto-dashboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 335 KiB |
63
quarto/quarto-dashboard.qmd
Normal file
63
quarto/quarto-dashboard.qmd
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
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()
|
||||
```
|
||||
:::
|
||||
BIN
quarto/quarto-shiny.png
Normal file
BIN
quarto/quarto-shiny.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
15
quarto/quarto-shiny.qmd
Normal file
15
quarto/quarto-shiny.qmd
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
format: html
|
||||
server: shiny
|
||||
---
|
||||
|
||||
```{r}
|
||||
library(shiny)
|
||||
|
||||
textInput("name", "What is your name?")
|
||||
numericInput("age", "How old are you?", NA, min = 0, max = 150)
|
||||
```
|
||||
|
||||
```{r}
|
||||
#| context: server
|
||||
```
|
||||
Binary file not shown.
Reference in New Issue
Block a user