if (FALSE) {
# literal vs regular expression vs anchored regular expression:
betydb_query(units = "Mg", table = "variables")
# NULL
betydb_query(units = "Mg/ha", table = "variables") %>% select(name) %>% c()
# $name
# [1] "a_biomass" "root_live_biomass"
# [3] "leaf_dead_biomass_in_Mg_ha" "SDM"
betydb_query(genus = "Miscanthus", table = "species") %>% nrow()
# [1] 10
(betydb_query(genus = "~misc", table = "species", api_version = "beta")
%>% select(genus)
%>% unique() %>% c())
# $genus
# [1] "Platymiscium" "Miscanthus" "Dermiscellum"
(betydb_query(genus = "~^misc", table = "species", api_version = "beta")
%>% select(genus)
%>% unique() %>% c())
# $genus
# [1] "Miscanthus"
}
Run the code above in your browser using DataLab