I try to pivot data in a dataframe, below code works for small dataframe, however for a bigger one (80k rows) it's just running seamingly forever.
reshape(SumData,direction = "wide",idvar = c("location","lat","lon","year"), timevar = "variable")
("variable" column has just two values if that matters)
Is there a more efficient way for this?