I have a data frame with names for row identity and dates as column identity.
df <- data.frame(`20171007` = c(8, 4),
`20171014` = c(9, 7),
row.names = c("Kohl", "Travis"))
What I want is a data structure with three columns, where the identity is actually data.
Date (get from column identity)
Name (get from row identity)
Value (get from df[r,c])
In this particular case I would end up with 4 rows, one for each value. How do I go about flattening my df
into that structure?