This question is related to: Count values in the columns separated by ":"
I have following list of tables:
ll = structure(list(`001` = structure(c(1L, 2L, 1L, 1L), .Dim = 4L, .Dimnames = structure(list(
c("Active", "Com.Tent", "Perform", "Sport_Well")), .Names = ""), class = "table"),
`002` = structure(c(1L, 2L, 5L, 2L), .Dim = 4L, .Dimnames = structure(list(
c("Active", "Com.Tent", "Perform", "Sport_Well")), .Names = ""), class = "table"),
`003` = structure(c(2L, 1L, 4L), .Dim = 3L, .Dimnames = structure(list(
c("Active", "Com.Tent", "Perform")), .Names = ""), class = "table")), .Names = c("001",
"002", "003"))
ll
$`001`
Active Com.Tent Perform Sport_Well
1 2 1 1
$`002`
Active Com.Tent Perform Sport_Well
1 2 5 2
$`003`
Active Com.Tent Perform
2 1 4
How can I convert this to following data frame:
user_id Active Com.tent Perform Sport_Well
001 1 2 1 1
002 1 2 5 2
003 2 1 4 0