BETYdb is the Biofuel Ecophysiological Traits and Yields Database. You can get many different types of data from this database, including trait data.
Function setup: All functions are prefixed with betydb_
.
Plural function names like betydb_traits()
accept
parameters and always give back a data.frame, while singlur function
names like betydb_trait()
accept an ID and give back a
list.
The idea with the functions with plural names is to search for either traits, species, etc., and with the singular function names to get data by one or more IDs.
Get trait data for Miscanthus giganteus
Summarise data from the output data.frame
suppressPackageStartupMessages(library("dplyr"))
out %>%
group_by(id) %>%
summarise(mean_result = mean(as.numeric(mean), na.rm = TRUE)) %>%
arrange(desc(mean_result))
#> # A tibble: 449 x 2
#> id mean_result
#> <int> <dbl>
#> 1 1666 27.4
#> 2 16845 27
#> 3 1669 26.4
#> 4 16518 26
#> 5 1663 25.4
#> 6 16742 25
#> 7 1594 24.8
#> 8 1674 22.7
#> 9 1606 22.5
#> 10 1665 22.5
#> # … with 439 more rows
Single trait
#> # A tibble: 1 x 13
#> id description units notes created_at updated_at name max min
#> <int> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 10 Leaf Perce… perc… <NA> <NA> 2011-06-0… leafN 10 0.02
#> # … with 4 more variables: standard_name <chr>, standard_units <chr>,
#> # label <chr>, type <chr>
Single species, Acacia karroothorn
#> # A tibble: 1 x 10
#> id spcd genus species scientificname commonname notes created_at
#> <int> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 10 <NA> Acac… karroo Acacia karroo karrootho… <NA> <NA>
#> # … with 2 more variables: updated_at <chr>, acceptedsymbol <chr>
Get citatons searching for Miscanthus
#> # A tibble: 1 x 13
#> id author year title journal vol pg url pdf created_at updated_at
#> <int> <chr> <int> <chr> <chr> <int> <chr> <chr> <chr> <chr> <chr>
#> 1 10 Casler 2003 Cult… Crop S… 43 2226… http… http… <NA> <NA>
#> # … with 2 more variables: doi <chr>, user_id <chr>