I'm using the DT package and I'd like to show two tables on separate panes with one dataset.
Ideally, I'd like something like facet wrap that would let me make tables based on the plan id. I'd like to have one table that has all the values for the personal plan and another table that has all the values for the team plan. I can go the long way around and make two separate datasets, but I'm hoping there's something that I can do that might be more efficient
This is my data
structure(list(first_month = structure(c(17532, 17532, 17563,
17563, 17591, 17591, 17622, 17622, 17652, 17652), class = "Date"),
plan_id = c("personal", "team", "personal", "team", "personal",
"team", "personal", "team", "personal", "team"), new_customers = c(16,
32, 27, 33, 19, 41, 36, 46, 48, 46), `1` = c(16, 32, 27,
33, 19, 41, 36, 46, 48, 46), `2` = c(13, 29, 24, 30, 15,
37, 31, 40, 43, 38), `3` = c(13, 26, 22, 28, 14, 31, 30,
40, 36, 35), `4` = c(10, 20, 22, 22, 12, 29, 27, 39, 32,
33), `5` = c(10, 18, 20, 20, 11, 25, 22, 36, 27, 27), `6` = c(10,
16, 16, 20, 9, 24, 19, 34, 24, 25), `7` = c(10, 12, 13, 18,
7, 24, 16, 32, 21, 23), `8` = c(8, 10, 10, 14, 7, 21, 16,
30, 19, 21), `9` = c(7, 8, 7, 12, 7, 18, 16, 25, NA, NA),
`10` = c(7, 7, 5, 11, 6, 14, NA, NA, NA, NA), `11` = c(5,
6, 5, 10, NA, NA, NA, NA, NA, NA), `12` = c(5, 6, NA, NA,
NA, NA, NA, NA, NA, NA)), row.names = c(NA, -10L), class = c("tbl_df",
"tbl", "data.frame"))
This is my code
datatable(monthly_new_customer_cohorts_formatted_as_cohort_analysis_customer_counts,
class = 'cell-border stripe',
rownames = FALSE,
options = list(
ordering=F,
dom = 't',
pageLength = 1000))