rbindlist_dts: Helper function for rbinding each ['data.table()'] nested...

Description Usage Arguments Value See Also Examples

View source: R/popReconstruct_draws.R

Description

Inputs multiple lists of data.tables that will be combined into one list of data.tables. data.tables are matched by the name of each element of each list. This is different than data.table::rbindlist() which inputs one list of data.tables and returns one combined data.table.

Usage

1

Arguments

...

multiple [list()] of many [data.table()]
as returned by popReconstruct_posterior_draws() or popReconstruct_prior_draws().

Value

one [list()] of many [data.table()]

See Also

Other popReconstruct: popReconstruct_fit(), popReconstruct_hyperparameters()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
list_dt1 <- list(
  "population" = data.table::data.table(
    sex = c("female", "male"),
    value = 2,
    method = 1
),
  "deaths" = data.table::data.table(
    sex = c("female", "male"),
    value = 4,
    method = 1
  )
)
list_dt2 <- list(
  "population" = data.table::data.table(
    sex = c("female", "male"),
    value = 2,
    method = 2
  ),
  "deaths" = data.table::data.table(
    sex = c("female", "male"),
    value = 4,
    method = 2
  )
)
combined_list_dt <- rbindlist_dts(list_dt1, list_dt2)

ihmeuw-demographics/popMethods documentation built on Jan. 29, 2021, 12:39 p.m.