Essentially a wrapper for pivot_longer that works on both a
single wide-shaped data.frame as well as a list of wide-shaped data.frame's
Usage
trans_wide_to_tidy(
wides,
data_cols = NA,
id_cols = NA,
names_to = "Well",
values_to = "Measurements",
values_to_numeric = TRUE,
...
)Arguments
- wides
A single wide-shaped
data.frame, or alistof wide-shapeddata.frame's- data_cols, id_cols
Specifies which columns have data vs are ID's (in pivot_longer parlance). Each can be a single
vector(which will be applied for alldata.frames) or alistofvectors, with eachvectorcorresponding to the same-indexdata.frameinwidesEntries that are
NAin thelistwill not be usedIf neither
data_colsnorid_colsare specified, user must provide arguments to pivot_longer via...for at least thecolsargument and these arguments provided via...will be used for allwidesdata.frame's- names_to, values_to
Specifies the output column names created by pivot_longer. Each can be provided as
vectors the same length aswides- values_to_numeric
logicalindicating whether values will be coerced tonumeric. See below for when this may be overridden by arguments passed in...- ...
Other arguments to be passed to pivot_longer Note that including
values_transformhere will override the behavior ofvalues_to_numeric