class: ALA-title-slide animated fadeIn <img class="logo" src="img/ALA_Logo_Stacked+Tagline_REV-RGB.png" width="40%" align="right"> <br> .main-title[<br><br><br>Mapping Australia’s biodiversity]<br> .main-subtitle[using R & the ALA]<br> <br> .white[ <b>Martin Westgate</b><br> Team Leader | Science & Decision Support | ALA<br> <br> NUMBATs seminar | Monash University | 2021-11-12 ] <br> <img class="logo" src="img/NCRIS_logo.png" width="10%" align="left"> <img class="logo" src="img/CSIRO_logo.png" width="10%" align="left"> <br> .small[The ALA is made possible by contributions from its many partners. It receives support through the Australian Government through the National Collaborative Research Infrastructure Strategy (NCRIS) and is hosted by CSIRO.] --- class: ALA-standard-slide animated fadeIn layout: true background-image: url(img/ALA_Logo_Inline_RGB.png) background-position: 90% 100% background-size: 20% --- .slide-title[Outline<br><br>] .slide-title[Identity] .slide-subtitle[ who we are]<br><br> .slide-title[Past] .slide-subtitle[ `ALA4R` & why we rebuilt it]<br><br> .slide-title[Present] .slide-subtitle[ `galah` & why it's good]<br><br> .slide-title[Future] .slide-subtitle[ R @ ALA] --- class: ALA-title-slide animated fadeIn layout: false .divider-text[<br><br><br>Identity] <br> .white[who we are] --- class: ALA-standard-slide animated fadeIn layout: true background-image: url(img/ALA_Logo_Inline_RGB.png) background-position: 90% 100% background-size: 20% --- .slide-title[Identity] .slide-subtitle[who we are] <br><br><br> .slide-title[Database] .slide-subtitle[ 101,466,364 biodiversity observations]<br><br> .slide-title[Network] .slide-subtitle[ 816 data providers]<br><br> .slide-title[Code] .slide-subtitle[ 221 GitHub repositories]<br><br> .slide-title[People] .slide-subtitle[ 34 staff]<br><br> --- .slide-title[Identity] .slide-subtitle[time] ![](2021_11_12_Monash_files/figure-html/unnamed-chunk-2-1.png)<!-- --> --- .slide-title[Identity] .slide-subtitle[space] ![](2021_11_12_Monash_files/figure-html/unnamed-chunk-3-1.png)<!-- --> --- .slide-title[Identity] .slide-subtitle[taxonomy] ![](2021_11_12_Monash_files/figure-html/unnamed-chunk-4-1.png)<!-- --> --- .slide-title[Identity] .slide-subtitle[applications] ![](2021_11_12_Monash_files/figure-html/unnamed-chunk-5-1.png)<!-- --> --- class: ALA-title-slide animated fadeIn layout: false .divider-text[<br><br><br>Past] <br> .white[`ALA4R` & why we rebuilt it] --- class: ALA-standard-slide animated fadeIn layout: true background-image: url(img/ALA_Logo_Inline_RGB.png) background-position: 90% 100% background-size: 20% --- .slide-title[Past] .slide-subtitle[`ALA4R`] <br> <br> .slide-title[Benefits] .slide-subtitle[<b>groundbreaking:</b> released in 2014]<br><br> .slide-subtitle[<b>flexible:</b> return the data you want, customised in various ways]<br><br> .slide-subtitle[<b>wide-ranging:</b> any query accessible via the API can be constructed] --- .slide-title[Past] .slide-subtitle[`ALA4R`] <br> <br> .slide-title[No function naming convention] .slide-subtitle[abbreviations: `aus()`]<br><br> .slide-subtitle[snake case: `ala_fields()`]<br><br> .slide-subtitle[contractions: `fieldguide()`]<br><br> .slide-subtitle[single words: `occurrences()`, `images()`] --- .slide-title[Past] .slide-subtitle[`ALA4R`] <br> <br> .slide-title[Confusing syntax] .slide-subtitle[unclear differences between functions:<br> `ala_list()`, `ala_lists()`, `specieslist()`<br> `search_layers`, `ala_fields`] .slide-subtitle[argument names require specialist knowledge:<br> `wkt`, `fq`, `qa`] .slide-subtitle[arguments require `solr` queries passed as strings:<br> `occurrences(taxon = "taxon_name:\"Alaba vibex\"")`] --- .slide-title[Past] .slide-subtitle[`ALA4R`] <br> <br> .slide-title[Inconsistent behaviour] .slide-subtitle[most functions return a `data.frame` (good)]<br><br> .slide-subtitle[`occurrences()` returns a `list`]<br><br> .slide-subtitle[`fieldguide()` and `plot.occurrences()` output a PDF] --- class: ALA-title-slide animated fadeIn layout: false .divider-text[<br><br><br>Present] <br> .white[`galah` and why it's good] --- class: ALA-standard-slide animated fadeIn layout: true background-image: url(img/ALA_Logo_Inline_RGB.png) background-position: 90% 100% background-size: 20% --- .slide-title[Present] .slide-subtitle[galah] .pull-left[ <img class="logo" src="img/galah_logo_final_midres.png" width="90%"> ] .pull-right[ .slide-subtitle[Data] - `ala_counts()` - `ala_species()` - `ala_occurrences()` - `ala_media()` - `ala_taxonomy()` .slide-subtitle[Filter] - `select_taxa()` - `select_filters()` - `select_locations()` - `select_fields()` .slide-subtitle[Lookup] - `search_fields()` - `find_field_values()` - `find_profiles()` - `find_profile_attributes()` - `find_atlases()` ] --- .slide-title[Present] .slide-subtitle[galah]
--- .slide-title[Present] .slide-subtitle[`galah::`] <div style="margin-top:-70px; margin-left:500px;">
</div> --- .slide-title[Present] .slide-subtitle[`galah::select_taxa`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r select_taxa("Mammalia") ``` ``` ## search_term scientific_name taxon_concept_id rank match_type kingdom phylum class ## 1 Mammalia MAMMALIA urn:lsid:biodiversity.org.au:afd.taxon:e9e7db31-04df-41fb-bd8d-e0b0f3c332d6 class exactMatch Animalia Chordata Mammalia ## vernacular_name issues ## 1 Mammals noIssue ``` --- .slide-title[Present] .slide-subtitle[`galah::select_taxa`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r family_tree <- ala_taxonomy(taxa = select_taxa("Mammalia"), down_to = "family") data.tree::ToDataFrameTypeCol(family_tree, type = "rank")[1:5, ] ``` ``` ## rank_class rank_subclass rank_order rank_suborder rank_family ## 1 Mammalia Eutheria Artiodactyla Ruminata Bovidae ## 2 Mammalia Eutheria Artiodactyla Ruminata Cervidae ## 3 Mammalia Eutheria Artiodactyla Suina Suidae ## 4 Mammalia Eutheria Artiodactyla Tylopoda Camelidae ## 5 Mammalia Eutheria Carnivora <NA> Canidae ``` --- .slide-title[Present] .slide-subtitle[`galah::select_taxa`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r ala_species(taxa = select_taxa("Lagomorpha")) ``` ``` ## kingdom phylum class order family genus species author ## 1 Animalia Chordata Mammalia Lagomorpha Leporidae Oryctolagus Oryctolagus cuniculus (Linnaeus, 1758) ## 2 Animalia Chordata Mammalia Lagomorpha Leporidae Lepus Lepus capensis Linnaeus, 1758 ## 3 Animalia Chordata Mammalia Lagomorpha Leporidae Lepus Lepus europaeus ## species_guid vernacular_name ## 1 urn:lsid:biodiversity.org.au:afd.taxon:692effa3-b719-495f-a86f-ce89e2981652 Rabbit ## 2 urn:lsid:biodiversity.org.au:afd.taxon:6240deca-2f4f-4bcd-a944-c49df0ae83b5 Brown Hare ## 3 NZOR-6-55337 ``` --- .slide-title[Present] .slide-subtitle[`galah::select_taxa`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r ala_counts(select_taxa("Lepus capensis")) ``` ``` ## [1] 6865 ``` --- .slide-title[Present] .slide-subtitle[`galah::select_taxa`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r ala_occurrences(select_taxa("Lepus capensis"))[1:3, ] ``` ``` ## decimalLatitude decimalLongitude eventDate scientificName taxonConceptID ## 1 -43.14459 147.8438 Lepus capensis urn:lsid:biodiversity.org.au:afd.taxon:6240deca-2f4f-4bcd-a944-c49df0ae83b5 ## 2 -42.96385 147.4906 Lepus capensis urn:lsid:biodiversity.org.au:afd.taxon:6240deca-2f4f-4bcd-a944-c49df0ae83b5 ## 3 -42.88732 147.8060 Lepus capensis urn:lsid:biodiversity.org.au:afd.taxon:6240deca-2f4f-4bcd-a944-c49df0ae83b5 ## recordID dataResourceName ## 1 5055c021-9e12-4529-a21a-3bfd2fe7eabd Tasmanian Natural Values Atlas ## 2 949263b7-4efe-4a0d-8271-c56a9bb0a8a3 Tasmanian Natural Values Atlas ## 3 329c8355-c6f9-4f72-844c-0e6f02ad3a34 Tasmanian Natural Values Atlas ``` --- .slide-title[Present] .slide-subtitle[`galah::select_filters`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r select_filters(year >= 2015) ``` ``` ## variable logical value query ## 1 year >= 2015 year:[2015 TO *] ``` --- .slide-title[Present] .slide-subtitle[`galah::select_filters`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r ala_counts(filters = select_filters(year >= 2015)) ``` ``` ## [1] 29674333 ``` --- .slide-title[Present] .slide-subtitle[`galah::select_filters`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r ala_counts(filters = select_filters(year >= 2015), group_by = "year") ``` ``` ## year count ## 1 2020 5808847 ## 2 2019 5480926 ## 3 2018 5406941 ## 4 2017 4637731 ## 5 2016 3839612 ## 6 2015 3597915 ## 7 2021 902361 ``` --- .slide-title[Present] .slide-subtitle[`galah::select_filters`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r nrow(search_fields()) ``` ``` ## [1] 794 ``` ```r search_fields("Australian states and territories") ``` ``` ## id description type ## 531 cl2013 ASGS Australian States and Territories Australian Statistical Geography Standard Australian States and Territories layers ## 610 cl22 Australian States and Territories Australian States and Territories layers ## link ## 531 http://abs.gov.au/AUSSTATS/abs@.nsf/DetailsPage/1270.0.55.001July%202011?OpenDocument ## 610 http://www.anzlic.org.au/infrastructure_GEN.html ``` --- .slide-title[Present] .slide-subtitle[`galah::select_filters`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r ala_counts(filters = select_filters(year >= 2015), group_by = "cl22") %>% filter(count > 10^4) %>% ggplot(aes(x = cl22, y = count)) + geom_bar(stat = "identity") + coord_flip() + theme_bw() ``` ![](2021_11_12_Monash_files/figure-html/unnamed-chunk-27-1.png)<!-- --> --- .slide-title[Present] .slide-subtitle[`galah::select_filters`] <div style="margin-top:-70px; margin-left:500px;">
</div> ```r ala_counts(filters = select_filters(year >= 2015), group_by = select_fields("cl22", "year", expand = TRUE)) %>% filter(count > 10^4) %>% ggplot(aes(x = year, y = cl22, fill = log(count))) + geom_tile() + theme_bw() ``` ![](2021_11_12_Monash_files/figure-html/unnamed-chunk-29-1.png)<!-- --> --- class: ALA-title-slide animated fadeIn layout: false .divider-text[<br><br><br>Future] <br> .white[Where next?] --- class: ALA-standard-slide animated fadeIn layout: true background-image: url(img/ALA_Logo_Inline_RGB.png) background-position: 90% 100% background-size: 20% --- .slide-title[Future] .slide-subtitle[galah] .pull-left[ <img class="logo" src="img/galah_logo_final_midres.png" width="90%"> ] .pull-right[ <br><br><br> .slide-title[Piping]<br> .slide-subtitle[`tidyverse` syntax for ALA queries]<br><br> ```r a_query_builder_function() %>% select_filters(year > 2010) %>% select_taxa("Heleioporus australiacus") %>% ala_counts() ``` ] --- .slide-title[Future] .slide-subtitle[upcoming projects] .pull-left[ <br><br><br> <img class="logo" src="img/ALA_Logo_Stacked_RGB.png" width="90%"> ] .pull-right[ <br><br><br> .slide-title[Import]<br> .slide-subtitle[fast upload of richer data types]<br><br> .slide-title[Cleaning]<br> .slide-subtitle[better detection & reporting of errors]<br><br> .slide-title[Support]<br> .slide-subtitle[code resources for researchers & analysts] ] --- <img src="img/ALA_labs_screenshot.png" width="95%"> .center[<em>labs.ala.org.au</em>] --- class: ALA-title-slide animated fadeIn layout: false <img class="logo" src="img/ALA_Logo_Stacked+Tagline_REV-RGB.png" width="40%" align="right"> .main-title[<br><br><br>Thank You]<br> .white[ <b>Martin Westgate</b><br> Team Leader | Science & Decision Support Team | Atlas of Living Australia<br><br> <b>t:</b> +61 422 522 494<br> <b>e:</b> martin.westgate@csiro.au <br> ] .small[ These slides were made with R v4.1.1 | rmarkdown | xaringan | ggplot2 | viridis | DiagrammeR ] <br> <br> <img class="logo" src="img/NCRIS_logo.png" width="10%" align="left"> <img class="logo" src="img/CSIRO_logo.png" width="10%" align="left"> <br> .small[The ALA is made possible by contributions from its many partners. It receives support through the Australian Government through the National Collaborative Research Infrastructure Strategy (NCRIS) and is hosted by CSIRO.]