I am having trouble with this relativity simple pivoting problem with tidyr. This is best illustrated by and example. I have this unprocessed data:
data_unprocessed <- tribble(
~statistic, ~value,
"median_geo_wo_nw", 2.66,
"median_travel_wo_nw", 4.11,
"mean_geo_wo_nw", 12.4,
"mean_travel_wo_nw", 34.2)
This I need to convert to wide format like so:
data_processed <- tribble(
~statistic, ~geo_distance, ~travel_distance,
"median", 2.66, 4.11,
"mean", 12.4, 34.2)
Sorry if this seems basic but I can't get it to work.
Thanks,