Convert a long data frame to a wide matrix, with time along the row dimension and locations along the column dimension. Values in the matrix could be e.g. the observed counts or the population.
df_to_matrix(df, time_col = 1, location_col = 2, value_col = 3)
A data frame with at least 3 columns.
Integer or string that specifies the time column.
Integer or string that specifies the location column.
Integer or string that specifies the value column.
A matrix with time on rows and locations on columns.