I would like to reshape a data frame of dimensions 103740 x 4 into wide format, i.e., to go from the first block of text below to the second. The following function works well enough when applied to part of the data frame but it exhausts my machine's available memory when applied to the full data frame: I would like to reshape a data frame of dimensi