epidict
The goal of {epidict} is to provide standardized data dictionaries for
use in epidemiological data analysis templates. Currently it supports
standardised dictionaries from MSF OCA. This is a product of the R4EPIs
project; learn more at https://r4epis.netlify.com
Installation
You can install {epidict} from CRAN:
install.packages("epidict")
Click here for alternative installation options
If there is a bugfix or feature that is not yet on CRAN, you can install
it via the {drat} package:
You can also install the in-development version from GitHub using the
{remotes} package (but there’s no guarantee that it will be stable):
``` r
# install.packages("remotes")
remotes::install_github("R4EPI/epidict")
```
Accessing dictionaries
There are four MSF outbreak dictionaries available in {epidict} based on
DHIS2 exports:
- Acute Jaundice Syndrome (often suspected to be Hepatitis E) (“AJS”)
- Cholera/Acute watery diarrhea (“Cholera”)
- Measles/Rubella (“Measles”)
- Meningitis (“Meningitis”)
You can read more about the outbreak dictionaries at
https://r4epis.netlify.com/outbreaks
The dictionary can be obtained via the msf_dict()
function, which
specifies a dictionary that describes recorded variables
(data_element_shortname
) in rows and their possible options (if
categorical):
Click here for code examples
``` r
library("epidict")
msf_dict("AJS")
#> # A tibble: 68 × 8
#> data_element_uid data_elem…¹ data_…² data_…³ data_…⁴ data_…⁵ used_…⁶ options
#>
#> 1 NA egen_044_e… event_… Is the… TEXT HgdrO8…
#> 2 NA egen_001_p… case_n… Anonym… TEXT
#> 3 NA egen_004_d… date_o… Date p… DATE
#> 4 NA egen_022_d… detect… How pa… TEXT BlfHX5…
#> 5 NA egen_005_p… patien… Patien… TEXT YNeOOp…
#> 6 NA egen_029_m… msf_in… How ex… TEXT PN5NWt…
#> 7 NA egen_008_a… age_ye… Age of… INTEGE…
#> 8 NA egen_009_a… age_mo… Age of… INTEGE…
#> 9 NA egen_010_a… age_da… Age of… INTEGE…
#> 10 NA egen_011_s… sex Sex of… TEXT orgc5Y…
#> # … with 58 more rows, and abbreviated variable names ¹data_element_name,
#> # ²data_element_shortname, ³data_element_description,
#> # ⁴data_element_valuetype, ⁵data_element_formname, ⁶used_optionset_uid
#> # ℹ Use `print(n = ...)` to see more rows
msf_dict("Cholera")
#> # A tibble: 45 × 8
#> data_element_uid data_elem…¹ data_…² data_…³ data_…⁴ data_…⁵ used_…⁶ options
#>
#> 1 AafTlSwliVQ egen_001_p… case_n… Anonym… TEXT Case n…
#> 2 OTGOtWBz39J egen_004_d… date_o… Date p… DATE Date o…
#> 3 wnmMr2V3T3u egen_006_p… patien… Locati… ORGANI… Patien…
#> 4 sbgqjeVwtb8 egen_008_a… age_ye… Age of… INTEGE… Age in…
#> 5 eXYhovYyl61 egen_009_a… age_mo… Age of… INTEGE… Age in…
#> 6 UrYJSk2Wp46 egen_010_a… age_da… Age of… INTEGE… Age in…
#> 7 D1Ky5K7pFN6 egen_011_s… sex Sex of… TEXT Sex orgc5Y…
#> 8 dTm5R53YYXC egen_012_p… pregna… Pregna… TEXT Pregna… IEjzG2…
#> 9 FF7d81Zy0yQ egen_013_p… trimes… If pre… TEXT Trimes… QjGHFN…
#> 10 vLAmA6Pmjip egen_014_p… foetus… If pre… TEXT Foetus… SR8Jtf…
#> # … with 35 more rows, and abbreviated variable names ¹data_element_name,
#> # ²data_element_shortname, ³data_element_description,
#> # ⁴data_element_valuetype, ⁵data_element_formname, ⁶used_optionset_uid
#> # ℹ Use `print(n = ...)` to see more rows
msf_dict("Measles")
#> # A tibble: 52 × 8
#> data_element_uid data_elem…¹ data_…² data_…³ data_…⁴ data_…⁵ used_…⁶ options
#>
#> 1 DE_EGEN_001 egen_001_p… case_n… Anonym… TEXT Case n…
#> 2 DE_EGEN_004 egen_004_d… date_o… Date p… DATE Date o…
#> 3 DE_EGEN_005 egen_005_p… patien… Patien… TEXT Patien… YNeOOp…
#> 4 DE_EGEN_006 egen_006_p… patien… Locati… ORGANI… Patien…
#> 5 DE_EGEN_008 egen_008_a… age_ye… Age of… INTEGE… Age in…
#> 6 DE_EGEN_009 egen_009_a… age_mo… Age of… INTEGE… Age in…
#> 7 DE_EGEN_010 egen_010_a… age_da… Age of… INTEGE… Age in…
#> 8 DE_EGEN_011 egen_011_s… sex Sex of… TEXT Sex orgc5Y…
#> 9 DE_EGEN_012 egen_012_p… pregna… Pregna… TEXT Pregna… IEjzG2…
#> 10 DE_EGEN_013 egen_013_p… trimes… If pre… TEXT Trimes… QjGHFN…
#> # … with 42 more rows, and abbreviated variable names ¹data_element_name,
#> # ²data_element_shortname, ³data_element_description,
#> # ⁴data_element_valuetype, ⁵data_element_formname, ⁶used_optionset_uid
#> # ℹ Use `print(n = ...)` to see more rows
msf_dict("Meningitis")
#> # A tibble: 53 × 8
#> data_element_uid data_elem…¹ data_…² data_…³ data_…⁴ data_…⁵ used_…⁶ options
#>
#> 1 AafTlSwliVQ egen_001_p… case_n… Anonym… TEXT Case n…
#> 2 OTGOtWBz39J egen_004_d… date_o… Date p… DATE Date o…
#> 3 udXAcFEE1dl egen_005_p… patien… Patien… TEXT Patien… YNeOOp…
#> 4 wnmMr2V3T3u egen_006_p… patien… Locati… ORGANI… Patien…
#> 5 sbgqjeVwtb8 egen_008_a… age_ye… Age of… INTEGE… Age in…
#> 6 eXYhovYyl61 egen_009_a… age_mo… Age of… INTEGE… Age in…
#> 7 UrYJSk2Wp46 egen_010_a… age_da… Age of… INTEGE… Age in…
#> 8 D1Ky5K7pFN6 egen_011_s… sex Sex of… TEXT Sex orgc5Y…
#> 9 ADfNqpCL5kf egen_015_e… exit_s… Final … TEXT Exit s… hO9TET…
#> 10 JZ8yqTow79G egen_016_d… date_o… Date p… DATE Exit d…
#> # … with 43 more rows, and abbreviated variable names ¹data_element_name,
#> # ²data_element_shortname, ³data_element_description,
#> # ⁴data_element_valuetype, ⁵data_element_formname, ⁶used_optionset_uid
#> # ℹ Use `print(n = ...)` to see more rows
```
In addition, there are four MSF survey dictionaries available:
- Retrospective mortality and access to care (“Mortality”)
- Malnutrition (“Nutrition”)
- Vaccination coverage long form (“vaccination_long”)
- Vaccination coverage short form (“vaccination_short”)
You can read more about the survey dictionaries at
https://r4epis.netlify.com/surveys
These are accessible via msf_dict_survey()
where the variables are in
name
. You can also read in your own Kobo (ODK) dictionaries by
specifying tempalte = FALSE
and then setting
name = <path to your .xlsx>
.
Click here for code examples
``` r
msf_dict_survey("Mortality")
#> # A tibble: 174 × 15
#> type name short…¹ label…² label…³ hint_…⁴ hint_…⁵ default relev…⁶ appea…⁷
#>
#> 1 start start start Start …
#> 2 end end end End Ti…
#> 3 today today today Date o…
#> 4 device… devi… device… Phone …
#> 5 date date Date o… Date Date today()
#> 6 integer team… Team n… Team n… Numéro… numbers
#> 7 village vill… Villag… Villag… Nom du…
#> 8 text vill… Other … Specif… Autre,… ${vill…
#> 9 integer clus… Cluste… Cluste… Numéro… numbers
#> 10 integer hous… Househ… Househ… Numéro… numbers
#> # … with 164 more rows, 5 more variables: constraint , repeat_count ,
#> # calculation , value_type , options , and abbreviated
#> # variable names ¹short_name, ²label_english, ³label_french, ⁴hint_english,
#> # ⁵hint_french, ⁶relevant, ⁷appearance
#> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
msf_dict_survey("Nutrition")
#> # A tibble: 27 × 15
#> type name short…¹ label…² label…³ hint_…⁴ hint_…⁵ repea…⁶ relev…⁷ calcu…⁸
#>
#> 1 start start Start … NA
#> 2 end end End Ti… NA
#> 3 today today Date o… NA
#> 4 device… devi… Phone … NA
#> 5 date date Date Date NA
#> 6 integer team… Team n… Team n… NA
#> 7 village vill… Villag… Villag… Nom du… NA
#> 8 text vill… Other … Specif… Précis… ${vill… NA
#> 9 geopoi… vill… Villag… Villag… Locali… NA
#> 10 integer clus… Cluste… Cluste… Numéro… NA
#> # … with 17 more rows, 5 more variables: constraint , appearance ,
#> # default , value_type , options , and abbreviated variable
#> # names ¹short_name, ²label_english, ³label_french, ⁴hint_english,
#> # ⁵hint_french, ⁶repeat_count, ⁷relevant, ⁸calculation
#> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
msf_dict_survey("Vaccination_long")
#> # A tibble: 106 × 15
#> type name short…¹ label…² label…³ hint_…⁴ hint_…⁵ default relev…⁶ appea…⁷
#>
#> 1 start start Start … Start …
#> 2 end end End Ti… End Ti…
#> 3 today today Date o… Date o…
#> 4 device… devi… Phone … Phone …
#> 5 date date Date Date Date today()
#> 6 integer team… Team n… Team n… Numéro…
#> 7 village vill… Villag… Villag… Nom du…
#> 8 text vill… Other … Specif… Veuill… ${vill…
#> 9 integer clus… Cluste… Cluste… Numéro… numbers
#> 10 integer hous… Househ… Househ… Numéro…
#> # … with 96 more rows, 5 more variables: repeat_count , constraint ,
#> # calculation , value_type , options , and abbreviated
#> # variable names ¹short_name, ²label_english, ³label_french, ⁴hint_english,
#> # ⁵hint_french, ⁶relevant, ⁷appearance
#> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
msf_dict_survey("Vaccination_short")
#> # A tibble: 38 × 16
#> type name short…¹ label…² label…³ hint_…⁴ hint_…⁵ default relev…⁶ appea…⁷
#>
#> 1 start start Start … Start …
#> 2 end end End Ti… End Ti…
#> 3 today today Date o… Date o…
#> 4 device… devi… Phone … Phone …
#> 5 date date Date Date Date .today…
#> 6 integer team… Team n… Team n… Numéro…
#> 7 village vill… Villag… Villag… Nom du…
#> 8 text vill… Other … Specif… Veuill… ${vill…
#> 9 integer clus… Cluste… Cluste… Numéro… numbers
#> 10 integer hous… Househ… Househ… Numéro…