I have a list like:
list(list(goals = c(42L, 52L, 55L),
season = "88",
player = c("a", "b","c")),
list(goals = c(41L,53L, 37L, 40L),
season = "89",
player = c("a","b", "c", "d")))
I want to convert this to a dataframe in long format like:
goals player season
42 a 88
52 b 88
.
.
41 a 89
53 b 89
.
I can achieve this using plyr
like:
plyr::ldply(mylist, data.frame, .id="season"
I'm thinking there is probably an updated way of doing this using purrr
ordplyr
?