`trait_pivot_wider` "widens" long format data ("tidy data").

Databases built with `traits.build` are organised in a long format where observations are on different rows and the type of observation is denoted by various identifying columns (e.g `trait_name`, `dataset_id`, `observation_id`, etc.). This function converts the data into wide format so that each trait in its own column.

db_traits_pivot_wider(traits)

Arguments

traits

The traits table from database (list object)

Value

A tibble in wide format

Details

`trait_pivot_wider` will return a single wide tibble; note that some meta-data columns (unit, replicates, measurement_remarks, basis_of_record, basis_of_value) will be excluded to produce a useful wide tibble.

Author

Daniel Falster - daniel.falster@unsw.edu.au

Examples

if (FALSE) {
data <- austraits$traits %>% filter(dataset_id == "Falster_2003")
data # Long format
traits_wide <- trait_pivot_wider(data)
traits_wide # Wide format
}