Skip to content

Commit ebdf50a

Browse files
committed
start of the csv example
1 parent 95d493e commit ebdf50a

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

hands-on.qmd

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,55 @@ library(duckdb) # Specific to duckDB
2020

2121
ARCTIC SHOREBIRD DEMOGRAPHICS NETWORK <https://doi.org/10.18739/A2222R68W>{target="_blank"}
2222

23-
Dataset hosted by the NSF Arctic Data Center (https://arcticdata.io)
23+
Data set hosted by the NSF Arctic Data Center (<https://arcticdata.io>)
2424

2525
Field data on shorebird ecology and environmental conditions were collected from 1993-2014 at 16 field sites in Alaska, Canada, and Russia.
2626

2727
Data were not collected in every year at all sites. Studies of the population ecology of these birds included nest-monitoring to determine timing of reproduction and reproductive success; live capture of birds to collect blood samples, feathers, and fecal samples for investigations of population structure and pathogens; banding of birds to determine annual survival rates; resighting of color-banded birds to determine space use and site fidelity; and use of light-sensitive geolocators to investigate migratory movements. Data on climatic conditions, prey abundance, and predators were also collected. Environmental data included weather stations that recorded daily climatic conditions, surveys of seasonal snowmelt, weekly sampling of terrestrial and aquatic invertebrates that are prey of shorebirds, live trapping of small mammals (alternate prey for shorebird predators), and daily counts of potential predators (jaegers, falcons, foxes). Detailed field methods for each year are available in the ASDN_protocol_201X.pdf files. All research was conducted under permits from relevant federal, state and university authorities.
2828

29-
See ` 01_ASDN_Readme.txt` provided in the data folder for metadata information about this data set.
29+
See ` 01_ASDN_Readme.txt` provided in the `data` folder for full metadata information about this data set.
3030

3131

3232

3333
## Analyzing the bird dataset using csv files (raw data)
3434

3535

36-
Let us import the csv file with the species information:
36+
Let us import the csv files with the species information:
3737

3838
```{r}
39+
# Import the species
40+
species_csv <- read_csv("data/species.csv")
3941
42+
glimpse(species_csv)
4043
```
44+
Let's explore what is in the `Relevance` attribute/column:
4145

46+
```{r}
47+
species_csv %>%
48+
group_by(Relevance) %>%
49+
count()
50+
```
51+
52+
We are interested in the `Study species` because according to the metadata they are the species that are
53+
included in the data sets for banding, resighting, and/or nest monitoring. Let us extract the species and sort them in alphabetical order:
54+
55+
```{r}
56+
# list of the bird species included in the study
57+
species_csv %>%
58+
filter(Relevance=="Study species") %>%
59+
select(Scientific_name) %>%
60+
arrange(Scientific_name)
61+
```
62+
63+
Now we can load more information about the sites, nests, and eggs monitoring
64+
65+
```{r}
66+
sites_csv <- read_csv("data/site.csv")
67+
68+
nests_csv <- read_csv("data/ASDN_Bird_nests.csv")
69+
70+
eggs_csv <- read_csv("data/ASDN_Bird_eggs.csv")
71+
```
4272

4373

4474
## Let's connect to our first database

0 commit comments

Comments
 (0)