`trait_pivot_longer` "gathers" wide format data into a "tidy" format.

This function converts the data into long format where observations are on different rows and the type of observation is denoted by the `trait_name` column. In other words, `trait_pivot_longer` reverts the actions of `trait_pivot_wider`.

db_traits_pivot_longer(wide_data)

Arguments

wide_data

Output from `trait_pivot_wider` (a tibble of wide data)

Value

A tibble in long format

Details

`trait_pivot_longer` will return a tibble with fewer columns than the original traits table The excluded columns include: "unit", "replicates", "measurement_remarks", "basis_of_record", "basis_of_value" # Double check #TODO

Author

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

Fonti Kar - fonti.kar@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

values_long <- trait_pivot_longer(traits_wide)
}