Closed jmh530 closed 4 years ago
We may eventually consider some sort of on-the-fly parsing for this, but it's unlikely to have a noticeable performance improvement unless you have very large data.
If you wanted to, you could also do it yourself by using pivot_longer_spec
I have a dataset that has character dates as some (but not all) of the column names. I can use pivot_longer to pivot to the shape I want, but this leaves the dates as characters. This is ok, but inhibits some kinds of analysis. To remedy this, I can then mutate those values in a post-processing step to get them as real dates. However, I presume this requires looping through the entire dataset. So if there are T of these columns, and N rows, then it requires NT mutations, rather than just T conversions normally. Ideally, there could be an option to pivot_longer/wider that would allow one to mutate/format the names before the final output.
Created on 2020-03-10 by the reprex package (v0.3.0)