Reshaping from long to wide with some missing data (NA's) on time invariant variables
问题 When using stats:::reshape() from base to convert data from long to wide format, for any variables designated as time invariant, reshape just takes the first observed value, and if the variable is actually varying in some way, outputs a warning. In my case, I have missing data on variables I would like to designate as time invariant, but since I have this data at other time points, I would like the value from those time points to be used rather than the NA which is first observed. testdata <-