Code Monkey home page Code Monkey logo

epidict's Introduction

Sitrep

Lifecycle: maturing CRAN status Codecov test coverage R build status

The goal of {sitrep} is provide report templates for common epidemiological surveys and outbreak reports. The package further contains helper function that standardize certain analyses.

While templates are primarily for MSF analyses - they have been setup to be as generic as possible for use by the general applied epidemiology community.

Detailed information about the project and the templates can be found at https://r4epis.netlify.com.
A reference website for the functions in {sitrep} can be found at https://r4epi.github.io/sitrep.

{sitrep} includes a number of other R packages which facilitate specific analysis:
{epitabulate}: Tables for epidemiological analysis
{epidict}: Epidemiology data dictionaries and random data generators
{epikit}: Miscellaneous helper tools for epidemiologists
{apyramid}: Age pyramid construction and plotting

Installation

The {sitrep} package, is currently stored in a GitHub repository. Therefore, the procedure to install these packages have one extra step required.

To install sitrep from GitHub you must first install the remotes package.

# install.packages("remotes")
remotes::install_github("r4epi/sitrep")

If you are getting errors, check the frequently asked questions.

Available templates

Sitrep has four outbreak templates and four survey templates available. These templates will generate the following:

  1. A word document with the situation report
  2. A plain text markdown document (for conversion to other formats such as HTML or PDF)
  3. A directory with all of the figures produced

You can access the list of templates in R Studio by clicking (see example below): file > New file > R Markdown… > From Template

Example of how to open and save the cholera template

You can generate an example template by using the check_sitrep_templates() function:

library("sitrep")
output_dir <- file.path(tempdir(), "sitrep_example")
dir.create(output_dir)

# view the available templates, categorized by type
available_sitrep_templates(categorise = TRUE)
#> $outbreak
#> [1] "ajs_outbreak"        "cholera_outbreak"    "measles_outbreak"   
#> [4] "meningitis_outbreak"
#> 
#> $survey
#> [1] "mortality"         "nutrition"         "vaccination_long" 
#> [4] "vaccination_short"

# generate the measles outbreak template in the output directory
check_sitrep_templates("measles_outbreak", path = output_dir)
#> [1] "C:\\Users\\alexf\\AppData\\Local\\Temp\\Rtmpcv1H8d/sitrep_example"

# view the contents
list.files(output_dir, recursive = TRUE)
#> [1] "measles_outbreak.Rmd"

Please note that the ‘sitrep’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

epidict's People

Contributors

aspina7 avatar zkamvar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

chr-hub

epidict's Issues

gen_data for measles order

pat posted in R4EPI/sitrep#223

Very minor but the generated dataset is in an unusual order ( just not what you'd expect )
sitrep/inst/rmarkdown/templates/measles_outbreak/skeleton/skeleton.Rmd

Line 140 in 9b44e40

linelist_raw <- gen_data("Measles")

Alex: yeah unsure when this happened but need to look in to.

Move `gen_polygon()` back into {sitrep}

the gen_polygon() function doesn't really have ANYTHING to do with data dictionaries and serves only to force import of the sf package. We would be better off moving it back to the {sitrep} package

Steps:

  • move to sitrep package
  • unimport sf package

survey dictionary odk issues

@pbkeating putting this in an issue for now as am merging the PR so dont want to loose

  • treatment_delay - restriction should be ${care_illness_last} = "yes", updated on github version
  • reason_first_hf_selected restriction should be ${place_first_hf} = "other" or ${place_first_hf} = "hospital" or ${place_first_hf} = "primary_health_centre" or ${place_first_hf} = "primary_health_unit", updated on github version

variable naming consistency between vaccination and nutrition:

  • number_children in nutrition and children_count in vaccination - should choose one and be consistent
  • num_qua**n**d_penta_woc should be num_quad_penta_woc - updated on github version (otherwise ruins iteration)
  • num_poliodrop_hf_woc and num_poliodrop_camp_woc should be changed to remove the num_ to be consistent with others - updated on github version (otherwise ruins iteration)

Release epidict 0.1.0

Prepare for release:

  • Check that description is informative
  • Check licensing of included files
  • usethis::use_cran_comments()
  • devtools::check()
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Create vignettes
  • Polish pkgdown reference index
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • Update cran-comments.md
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Update install instructions in README
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

generalising survey dictionary functions

would be good for surveys to make the functions more generic, this would be possible for kobo:

  • already able to read in a generic kobo xlsx form
  • make gen data run itself because xlsx forms contain rules (can pull out the ${variable_name} and all operators are standard after that too, e.g. ="yes", or/and, </>=)
    • useful in the future because then can just be sent dictionaries

Change package name to epidict

The name {msfdict} implies that these are only dictionaries for MSF. If we change it to {epidict}, then we could allow further dictionaries from orgs like WHO AFRO

Steps:

  • search replace msfdict with epidict
  • rename dictionary files to have the MSF prefix
  • add function called get_dict() and make it general for any dictionary by adding org argument, setting it to default for MSF.
  • add org = "MSF" for the gen_data() function.
  • replace insides of msf_*() to use gen_dict()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.