Skip to content

Commit ae71c97

Browse files
committed
moving data set first + some formatting improvements
1 parent 3263035 commit ae71c97

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

hands-on.qmd

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ execute:
44
warning: false
55
---
66

7-
Loading the necessary packages. DuckDB has its own R package that is mostly a wrapper around dbplyr and DBI
8-
9-
```{r}
10-
#| message: false
11-
12-
library(tidyverse)
13-
library(dbplyr) # to query databases in a tidyverse style manner
14-
library(DBI) # to connect to databases
15-
# install.packages("duckdb") # install this package to get duckDB API
16-
library(duckdb) # Specific to duckDB
17-
```
18-
197
## The dataset
208

219
ARCTIC SHOREBIRD DEMOGRAPHICS NETWORK [https://doi.org/10.18739/A2222R68W](https://doi.org/10.18739/A2222R68W){target="_blank"}
@@ -33,7 +21,19 @@ See `01_ASDN_Readme.txt` provided in the `data` folder for full metadata informa
3321

3422
## Analyzing the bird dataset using csv files (raw data)
3523

36-
Let us import the csv files with the bird species information:
24+
Loading the necessary packages. DuckDB has its own R package that is mostly a wrapper around dbplyr and DBI.
25+
26+
```{r}
27+
#| message: false
28+
29+
library(tidyverse)
30+
library(dbplyr) # to query databases in a tidyverse style manner
31+
library(DBI) # to connect to databases
32+
# install.packages("duckdb") # install this package to get duckDB API
33+
library(duckdb) # Specific to duckDB
34+
```
35+
36+
Import the csv files with the bird species information:
3737

3838
```{r}
3939
# Import the species
@@ -68,7 +68,7 @@ species_study
6868

6969
:::{.callout-tip}
7070
## Analysis
71-
We would like to know what is the average egg size for each of those bird species. How would we do that?
71+
***We would like to know what is the average egg size for each of those bird species. How would we do that?***
7272
:::
7373

7474
We will need more information that what we have in our species table. Actually we will need to also retrieve information from the nests and eggs monitoring table.
@@ -237,7 +237,7 @@ species_db %>%
237237
show_query()
238238
```
239239
:::{.callout-caution}
240-
Limitation: no way to add or update data in the database, `dbplyr` is view only. If you want to add or update data, you'll need to use the `DBI` package functions.
240+
****Limitation: no way to add or update data in the database, `dbplyr` is view only. If you want to add or update data, you'll need to use the `DBI` package functions.***
241241
:::
242242

243243
### Average egg volume analysis
@@ -284,7 +284,7 @@ species_egg_volume_avg_db <- left_join(nests_db, eggs_area_db, by="Nest_ID") %>%
284284

285285
:::{.callout-note}
286286
## Question
287-
Why does the SQL query include the volume computation?
287+
***Why does the SQL query include the volume computation?***
288288
:::
289289

290290
### Disconnecting from the database

0 commit comments

Comments
 (0)