I have a frequency table that has different column numbers. I am using the following code but it is not resulting in accurate results.
data_cbind <- cbind(table_45_1, table_45_3, table_45_6 table_45_12)
head(table_45_1)
1 2 3
30 4 1
head(table_45_3)
1 2 3 4
10 8 1 1
head(table_45_6)
1 2
12 5
head(table_45_12)
1
1
I want to organize the data as follows:
data
table_45_1 <- structure(c(`1` = 30L, `2` = 4L, `3` = 1L), dim = 3L, dimnames = structure(list( c("1", "2", "3")), names = ""), class = "table")
table_45_3 <- structure(c(`1` = 10L, `2` = 8L, `3` = 1L, `4` = 1L), dim = 4L, dimnames = structure(list( c("1", "2", "3", "4")), names = ""), class = "table")
table_45_6 <- structure(c(`1` = 12L, `2` = 5L), dim = 2L, dimnames = structure(list( c("1", "2")), names = ""), class = "table")
table_45_12 <- structure(c(`1` = 1L), dim = 1L, dimnames = structure(list("1"), names = ""), class = "table")