@@ -75,7 +75,7 @@ head(sampling_framework_abv)
7575The ABV data is downloaded as a cube from GBIF.org. We set the randomization to zero, since the monitoring takes place in specific squares.
7676The zip file is stored under * ./data/raw* .
7777
78- > GBIF.org (15 April 2025) GBIF Occurrence Download https://doi.org/10.15468/dl.ddzhrc
78+ > GBIF.org (01 September 2025) GBIF Occurrence Download https://doi.org/10.15468/dl.bjzbrv
7979
8080``` {r}
8181# nolint start: line_length_linter.
@@ -84,10 +84,14 @@ query_abv <- "SELECT
8484 GBIF_MGRSCode(1000, decimalLatitude, decimalLongitude, 0) AS mgrsCode,
8585 speciesKey,
8686 species,
87+ \"order\",
8788 family,
89+ genus,
8890 COUNT(*) AS n,
8991 MIN(COALESCE(coordinateUncertaintyInMeters, 0)) AS minCoordinateUncertaintyInMeters,
90- IF(ISNULL(family), NULL, SUM(COUNT(*)) OVER (PARTITION BY family)) AS familyCount
92+ IF(ISNULL(\"order\"), NULL, SUM(COUNT(*)) OVER (PARTITION BY \"order\")) AS orderCount,
93+ IF(ISNULL(family), NULL, SUM(COUNT(*)) OVER (PARTITION BY family)) AS familyCount,
94+ IF(ISNULL(genus), NULL, SUM(COUNT(*)) OVER (PARTITION BY genus)) AS genusCount
9195 FROM
9296 occurrence
9397 WHERE
@@ -109,7 +113,9 @@ query_abv <- "SELECT
109113 \"year\",
110114 mgrsCode,
111115 speciesKey,
116+ \"order\",
112117 family,
118+ genus,
113119 species
114120 ORDER BY
115121 \"year\" ASC,
@@ -137,7 +143,7 @@ glimpse(abv_data_total)
137143The cube data is downloaded as a cube from GBIF.org.
138144The zip file is stored under * ./data/raw* .
139145
140- > GBIF.org (15 April 2025) GBIF Occurrence Download https://doi.org/10.15468/dl.mn4ybb
146+ > GBIF.org (01 September 2025) GBIF Occurrence Download https://doi.org/10.15468/dl.vvqewm
141147
142148``` {r}
143149# nolint start: line_length_linter.
@@ -147,10 +153,14 @@ query_birdcube <- "SELECT
147153 COALESCE(coordinateUncertaintyInMeters, 1000)) AS mgrsCode,
148154 speciesKey,
149155 species,
156+ \"order\",
150157 family,
158+ genus,
151159 COUNT(*) AS n,
152- MIN(COALESCE(coordinateUncertaintyInMeters, 1000)) AS minCoordinateUncertaintyInMeters,
153- IF(ISNULL(family), NULL, SUM(COUNT(*)) OVER (PARTITION BY family)) AS familyCount
160+ MIN(COALESCE(coordinateUncertaintyInMeters, 0)) AS minCoordinateUncertaintyInMeters,
161+ IF(ISNULL(\"order\"), NULL, SUM(COUNT(*)) OVER (PARTITION BY \"order\")) AS orderCount,
162+ IF(ISNULL(family), NULL, SUM(COUNT(*)) OVER (PARTITION BY family)) AS familyCount,
163+ IF(ISNULL(genus), NULL, SUM(COUNT(*)) OVER (PARTITION BY genus)) AS genusCount
154164 FROM
155165 occurrence
156166 WHERE
@@ -172,7 +182,9 @@ query_birdcube <- "SELECT
172182 \"year\",
173183 mgrsCode,
174184 speciesKey,
185+ \"order\",
175186 family,
187+ genus,
176188 species
177189 ORDER BY
178190 \"year\" ASC,
@@ -338,8 +350,9 @@ We select the columns we want in a logical order:
338350
339351``` {r}
340352abv_data_out_sf <- abv_data_total_sf %>%
341- select("mgrscode", "year", "specieskey", "species", "family", "n",
342- "mincoordinateuncertaintyinmeters", "familycount", "geometry")
353+ select("mgrscode", "year", "specieskey", "species", "order", "family",
354+ "genus", "n", "mincoordinateuncertaintyinmeters",
355+ "ordercount", "familycount", "genuscount", "geometry")
343356abv_data_out <- st_drop_geometry(abv_data_out_sf)
344357
345358colnames(sampling_framework_abv_sf) <- tolower(
@@ -351,8 +364,9 @@ sampling_framework_out_sf <- sampling_framework_abv_sf %>%
351364sampling_framework_out <- st_drop_geometry(sampling_framework_out_sf)
352365
353366birdcube_data_out_sf <- birdcube_data_total_sf %>%
354- select("mgrscode", "year", "specieskey", "species", "family", "n",
355- "mincoordinateuncertaintyinmeters", "familycount", "geometry")
367+ select("mgrscode", "year", "specieskey", "species", "order", "family",
368+ "genus", "n", "mincoordinateuncertaintyinmeters",
369+ "ordercount", "familycount", "genuscount", "geometry")
356370birdcube_data_out <- st_drop_geometry(birdcube_data_out_sf)
357371```
358372
0 commit comments