R/trait_pivot_wider.R
trait_pivot_wider.Rd
trait_pivot_wider
"widens" long format data ("tidy data")
AusTraits data is 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 it's own column.
trait_pivot_wider(traits)
The traits table from austraits list object
list of five tibbles in wide format
For AusTraits <=v3.0.2, some studies have multiple rows of data for each observation_id, so trait_pivot_wider
will return four lists (value, unit, value_type, date and replicates) with the identifying columns and trait data arranged in columns.
For AusTraits >3.0.2, trait_pivot_wider
will return a single widen 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.