I\'m trying to use dcast from the latest reshape2 package (1.2.1) to denormalize a data frame (or data.table) where the value.var is a POSIXct type, but in the resulting dat
Pre- and/or post-processing for dates integrity when casting/widening a dataset can be very cumbersome.
In that respect, unless the reshaping you need is complicated, pivot_wider() from package tidyr is respectful of dates objects -- no conversion along the way. In addition, it gives a lot more control over the casting/widening process, thus avoiding post-processing steps (https://tidyr.tidyverse.org/reference/pivot_wider.html).