-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheda-basic.qmd
More file actions
46 lines (35 loc) · 842 Bytes
/
eda-basic.qmd
File metadata and controls
46 lines (35 loc) · 842 Bytes
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
---
title: "Penguins EDA"
format:
html:
code-fold: true
embed-resources: true
---
```{r}
con <- DBI::dbConnect(duckdb::duckdb())
DBI::dbExecute(con, "INSTALL httpfs")
DBI::dbExecute(con, "LOAD httpfs")
DBI::dbExecute(con, "CREATE VIEW penguin AS SELECT * FROM read_parquet('s3://do4ds-lab-kyle/data/penguins.parquet')")
df <- dplyr::tbl(con, "penguin") |> dplyr::collect()
```
```{r}
df |>
dplyr::group_by(species, sex) |>
dplyr::summarise(
dplyr::across(
dplyr::where(is.numeric),
\(x) mean(x, na.rm = TRUE)
)
) |>
knitr::kable()
```
## Penguin Size vs Mass by Species
```{r}
df |>
ggplot2::ggplot(ggplot2::aes(x = bill_length_mm, y = body_mass_g, color = species)) +
ggplot2::geom_point() +
ggplot2::geom_smooth(method = "lm")
```
```{r}
DBI::dbDisconnect(con)
```