df_gather_by_pattern | R Documentation |
Makes a data.frame tidyr by gathering columns that are variants of each other, such as for different years.
df_gather_by_pattern(
data,
pattern,
key_col = ".varying",
id_col = ".id",
method = "pure_tidyr"
)
data |
(data.frame) A data.frame to tidy. |
pattern |
(chr sclr) The regex pattern to group variables by. |
varying_name |
(chr sclr) A name to use for the column of varying part of the name, e.g. the year. Defaults to ".varying". |
A tidy data.frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.