Skip to contents

atlas_counts supports server-side grouping of data. Grouping can be used to return record counts grouped by multiple, valid fields (found by search_all(fields). Use galah_group_by when using the group_by argument of atlas_counts to return record counts summed by one or more valid fields.

Usage

galah_group_by(..., expand = TRUE)

Arguments

...

zero or more individual column names to include

expand

logical: When passed to group_by argument of atlas_counts, should factor levels be expanded? Defaults to TRUE.

Value

If any arguments are provided, returns a data.frame with columns name and type, as per galah_select(); if no arguments are provided, returns NULL.

See also

Examples

galah_call() |> 
  galah_group_by(basisOfRecord) |>
  atlas_counts()
#> # A tibble: 9 × 2
#>   basisOfRecord          count
#>   <chr>                  <int>
#> 1 HUMAN_OBSERVATION   86533156
#> 2 PRESERVED_SPECIMEN  14101366
#> 3 OBSERVATION          5305852
#> 4 OCCURRENCE           3222676
#> 5 MACHINE_OBSERVATION  2124046
#> 6 MATERIAL_SAMPLE      1516676
#> 7 LIVING_SPECIMEN       213918
#> 8 MATERIAL_CITATION      14961
#> 9 FOSSIL_SPECIMEN         5359