Skip to contents

Subset the epidemiological parameter columns by parameter type

Usage

get_key_columns(
  data,
  parameter_name = c("cfr", "delays", "sero", "risk_factors", "reproduction_number",
    "genomic", "attack_rate", "doubling_time", "growth_rate", "overdispersion",
    "relative_contribution"),
  all_columns = FALSE
)

Arguments

data

The parameter data.frame ($param) from load_epidata().

parameter_name

A character string with the parameter name. Options are: "cfr", "delay", "sero", "risk", "reproduction_number", and "genomic".

all_columns

The default is FALSE meaning that only the key columns specified for the specific parameter will be retrieved. If TRUE, then all columns in the data.frame will be retrieved.

Value

A data.frame with the key columns for the selected parameter.

Examples

lassa_data <- load_epidata("lassa")
#> Rows: 107 Columns: 2
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ";"
#> chr (2): parameter_type_short, parameter_type_full
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
#>  Data loaded for lassa
lassa_params <- lassa_data$params
cfr_lassa <- get_parameter(
  data = lassa_params,
  parameter_name = "Severity - case fatality rate (CFR)"
)
get_key_columns(data = cfr_lassa, parameter_name = "cfr")
#> # A tibble: 85 × 12
#>    article_label      article_info     population_country population_sample_size
#>    <chr>              <chr>            <chr>                               <int>
#>  1 PA 1986            PA 1986 (Transa… Sierra Leone                          225
#>  2 J. 1998            J. 1998 (Journa… Guinea                                 12
#>  3 Nathan Y 2018      10.3389/fpubh.2… Nigeria                                11
#>  4 Jeffrey 2014       10.1371/journal… Sierra Leone                         1740
#>  5 Prerana 2015       10.4269/ajtmh.1… Sierra Leone                           21
#>  6 Michael E 1988 (1) Michael E 1988 … Sierra Leone                           68
#>  7 Michael E 1988 (2) Michael E 1988 … Sierra Leone                           79
#>  8 H. 1972            H. 1972 (Transa… Nigeria                                23
#>  9 Peter 2018         10.1016/S1473-3… Nigeria                               284
#> 10 J. 1980            J. 1980 (Tropen… Guinea, Liberia, …                     42
#> # ℹ 75 more rows
#> # ℹ 8 more variables: population_sample_type <chr>, population_group <chr>,
#> #   method_disaggregated <lgl>, parameter_type <chr>, parameter_value <dbl>,
#> #   cfr_ifr_numerator <int>, cfr_ifr_denominator <int>, cfr_ifr_method <chr>