readepi

An R package for importing epi data into R.

https://github.com/epiverse-trace/readepi

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 9 committers (22.2%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (21.0%) to scientific vocabulary

Keywords

data-import epidemiology epiverse health-information-systems r r-package

Keywords from Contributors

best-practices internal-docs onboarding r-package-development standard-operating-procedure standards
Last synced: 6 months ago · JSON representation ·

Repository

An R package for importing epi data into R.

Basic Info
Statistics
  • Stars: 6
  • Watchers: 6
  • Forks: 5
  • Open Issues: 14
  • Releases: 1
Topics
data-import epidemiology epiverse health-information-systems r r-package
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.Rmd

---
output: github_document
editor_options: 
  markdown: 
    wrap: 72
---








```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse  = TRUE,
  comment   = "#>",
  fig.path  = "man/figures/README-",
  out.width = "100%"
)
```

# readepi: Read data from health information systems 


[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit/)
[![R-CMD-check](https://github.com/epiverse-trace/readepi/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/epiverse-trace/readepi/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/epiverse-trace/readepi/branch/main/graph/badge.svg)](https://app.codecov.io/gh/epiverse-trace/readepi?branch=main) [![lifecycle-concept](https://raw.githubusercontent.com/reconverse/reconverse.github.io/master/images/badge-maturing.svg)](https://www.reconverse.org/lifecycle.html#concept)


**{readepi}** is an R package for reading data from several health information systems (HIS) including public repositories, relational database management systems (RDBMS).

**{readepi}** currently supports reading data from the followings:

-   RDBMS (Relational Database Management Systems) such as MS SQL,  MySQL, and PostgreSQL\ 
- [REDCap](https://projectredcap.org/software/): Research Electronic Data Capture - a secure web application for building and managing online surveys and databases\
-   [DHIS2](https://dhis2.org/about/): an open source and web-based platform for managing health information\
-   [Fingertips](https://fingertips.phe.org.uk/): a repository of public health indicators in England

**{readepi}** returns a list object containing one or more data frames. **{readepi}** also has a number of auxiliary functions that allow importing a subset of the original dataset.

**{readepi}** is developed by [Epiverse-TRACE](https://data.org/initiatives/epiverse/) team at the [Medical Research Center, The Gambia unit at London School of Hygiene and Tropical Medicine](https://www.lshtm.ac.uk/research/units/mrc-gambia).


## Installation

You can install the development version of **{readepi}** from [GitHub](https://github.com/epiverse-trace/readepi) with:

```{r message=FALSE}
if (!require("pak")) install.packages("pak")
pak::pak("epiverse-trace/readepi")
library(readepi)
```

## Quick start

The main function in **{readepi}**  is `readepi()`. It reads data from a specified source. The `readepi()` function accepts a user-supplied string (the API's URL) as argument. Other specific arguments can be provided depending on the data source (see the **vignette** for more details). The examples below show how to use the `readepi()` function to import data from a variety of sources.

### Reading data from RDBMS and HIS

The `readepi()` function can import data from a variety of RDBMS, including MS SQL, MySQL, and PostgreSQL. Reading data from a RDBMS requires the following:

1. A MS SQL driver that is compatible with the version of DBMS of interest. The **vignette** describes how to install the appropriate driver for each database management system.\
2. Valid Credentials to access the server. The user credential details are expected to be stored in a file that will be supplied as an argument of the `readepi()` function. Use the `show_example_file()` function to visualize the structure of the template credential file.

Users can read data from a RDBMS by providing the details of the tables of interest or an SQL query (for more information, see the **vignette**). 

```{r eval=FALSE}
# DEFINE THE PATH TO THE CREDENTIAL FILE
credentials_file <- system.file("extdata", "test.ini", package = "readepi")

# DISPLAY THE STRUCTUTRE OF THE TEMPLATE CREDENTIAL FILE
show_example_file()

# READING FILE FROM A PROJECT IN A REDCap DATABASE
dat <- readepi(
  data_source      = "https://bbmc.ouhsc.edu/redcap/api/",
  credentials_file = credentials_file
)
project_data     <- dat$data # accessing the actual data
project_metadeta <- dat$metadata # accessing the metadata associated with project

# VIEWING THE LIST OF ALL TABLES IN A MySQL DATABASE
show_tables(
  data_source      = "mysql-rfam-public.ebi.ac.uk",
  credentials_file = credentials_file,
  driver_name      = "" # note that this example MySQL server does not require a driver
)

# VISUAIZE FIRST 5 ROWS OF THE TABLE 'AUTHOR'
visualise_table(
  data_source      = "mysql-rfam-public.ebi.ac.uk",
  credentials_file = credentials_file,
  from             = "author", # this is the table name
  driver_name      = ""
)

# READING ALL FILEDS AND RECORDS FROM A MySQL SERVER
dat <- readepi(
  data_source      = "mysql-rfam-public.ebi.ac.uk",
  credentials_file = credentials_file,
  from             = "author", # this is the table name
  driver_name      = ""
)

# READING DATA FROM DHIS2
dat <- readepi(
  data_source        = "https://play.dhis2.org/dev",
  credentials_file   = credentials_file,
  dataset            = "BfMAe6Itzgt",
  organisation_unit  = "Umh4HKqqFp6",
  data_element_group = NULL,
  start_date         = "2014",
  end_date           = "2023"
)

# READING DATA FROM THE FINGERTIPS REPOSITORY
dat <- readepi(
  indicator_id        = 90362,
  area_type_id        = 202,
  parent_area_type_id = 6 # optional
)
```

## Package Vignettes

The vignette of the **{readepi}** package contains detailed illustrations about the use of each function and the description of every argument. This can be accessed by typing the command below:

```{r eval=FALSE}
# OPEN THE VIGNETTE WITHIN RSTUDIO
vignette("readepi")

# OPEN THE VIGNETTE IN YOUR WEB BROWSER.
browseVignettes("readepi")
```

## Development

### Lifecycle

This package is currently a *maturing*, as defined by the [RECON software
lifecycle](https://www.reconverse.org/lifecycle.html). This means that it can be used in production with the understanding that the interface may still undergo minor changes.


### Contributions

Contributions are welcome via [pull requests](https://github.com/{{ gh_repo }}/pulls).

### Code of Conduct

Please note that the {{ packagename }} project is released with a 
[Contributor Code of Conduct](https://github.com/epiverse-trace/.github/blob/main/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.

Owner

  • Name: Epiverse-TRACE
  • Login: epiverse-trace
  • Kind: organization

Citation (CITATION.cff)

# --------------------------------------------
# CITATION file created with {cffr} R package
# See also: https://docs.ropensci.org/cffr/
# --------------------------------------------
 
cff-version: 1.2.0
message: 'To cite package "readepi" in publications use:'
type: software
license: MIT
title: 'readepi: Read Data from Health Information Systems'
version: 0.1.0
abstract: Data import from several health information systems ('HIS'). The current
  version of the package covers 'HIS' such as 'MS SQL', 'MySQL', and 'PostGRESQL'
  servers, 'REDCap', 'DHIS2' and 'Fingertips'.
authors:
- family-names: Mané
  given-names: Karim
  email: karim.mane@lshtm.ac.uk
  orcid: https://orcid.org/0000-0002-9892-2999
preferred-citation:
  type: manual
  title: Read Data From Health Information Systems
  authors:
  - family-names: Mané
    given-names: Karim
    email: karim.mane@lshtm.ac.uk
    orcid: https://orcid.org/0000-0002-9892-2999
  - family-names: Mohammed
    given-names: Nuredin
  - family-names: Bah
    given-names: Bubacarr
  - family-names: Ahadzie
    given-names: Bankolé
  - family-names: Degoot
    given-names: Abdoelnaser
  year: '2023'
  url: https://github.com/epiverse-trace/readepi
repository-code: https://github.com/epiverse-trace/readepi
url: https://epiverse-trace.github.io/readepi/
contact:
- family-names: Mané
  given-names: Karim
  email: karim.mane@lshtm.ac.uk
  orcid: https://orcid.org/0000-0002-9892-2999
keywords:
- data-import
- epidemiology
- epiverse
- health-information-systems
- r
- r-package
references:
- type: software
  title: checkmate
  abstract: 'checkmate: Fast and Versatile Argument Checks'
  notes: Imports
  url: https://mllg.github.io/checkmate/
  repository: https://CRAN.R-project.org/package=checkmate
  authors:
  - family-names: Lang
    given-names: Michel
    email: michellang@gmail.com
    orcid: https://orcid.org/0000-0001-9754-0393
  year: '2024'
- type: software
  title: DBI
  abstract: 'DBI: R Database Interface'
  notes: Imports
  url: https://dbi.r-dbi.org
  repository: https://CRAN.R-project.org/package=DBI
  authors:
  - name: R Special Interest Group on Databases (R-SIG-DB)
  - family-names: Wickham
    given-names: Hadley
  - family-names: Müller
    given-names: Kirill
    email: kirill@cynkra.com
    orcid: https://orcid.org/0000-0002-1416-3412
  year: '2024'
- type: software
  title: dplyr
  abstract: 'dplyr: A Grammar of Data Manipulation'
  notes: Imports
  url: https://dplyr.tidyverse.org
  repository: https://CRAN.R-project.org/package=dplyr
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
    orcid: https://orcid.org/0000-0003-4757-117X
  - family-names: François
    given-names: Romain
    orcid: https://orcid.org/0000-0002-2444-4226
  - family-names: Henry
    given-names: Lionel
  - family-names: Müller
    given-names: Kirill
    orcid: https://orcid.org/0000-0002-1416-3412
  - family-names: Vaughan
    given-names: Davis
    email: davis@posit.co
    orcid: https://orcid.org/0000-0003-4777-038X
  year: '2024'
- type: software
  title: fingertipsR
  abstract: 'fingertipsR: Fingertips Data for Public Health'
  notes: Imports
  url: https://fingertips.phe.org.uk
  authors:
  - family-names: Westermann
    given-names: Annabel
    email: annabel.westermann@dhsc.gov.uk
  - family-names: Fox
    given-names: Sebastian
    email: sebsfox@gmail.com
  - family-names: Nanayakkara
    given-names: Hadley
    email: hadley.nanayakkara@dhsc.gov.uk
  - family-names: Flowers
    given-names: Julian
  year: '2024'
  version: '>= 1.0.10.9001'
- type: software
  title: glue
  abstract: 'glue: Interpreted String Literals'
  notes: Imports
  url: https://glue.tidyverse.org/
  repository: https://CRAN.R-project.org/package=glue
  authors:
  - family-names: Hester
    given-names: Jim
    orcid: https://orcid.org/0000-0002-2739-7082
  - family-names: Bryan
    given-names: Jennifer
    email: jenny@posit.co
    orcid: https://orcid.org/0000-0002-6983-2759
  year: '2024'
- type: software
  title: httr2
  abstract: 'httr2: Perform HTTP Requests and Process the Responses'
  notes: Imports
  url: https://httr2.r-lib.org
  repository: https://CRAN.R-project.org/package=httr2
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@rstudio.com
  year: '2024'
- type: software
  title: magrittr
  abstract: 'magrittr: A Forward-Pipe Operator for R'
  notes: Imports
  url: https://magrittr.tidyverse.org
  repository: https://CRAN.R-project.org/package=magrittr
  authors:
  - family-names: Bache
    given-names: Stefan Milton
    email: stefan@stefanbache.dk
  - family-names: Wickham
    given-names: Hadley
    email: hadley@rstudio.com
  year: '2024'
- type: software
  title: odbc
  abstract: 'odbc: Connect to ODBC Compatible Databases (using the DBI Interface)'
  notes: Imports
  url: https://odbc.r-dbi.org
  repository: https://CRAN.R-project.org/package=odbc
  authors:
  - family-names: Hester
    given-names: Jim
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  - family-names: Gjoneski
    given-names: Oliver
  year: '2024'
- type: software
  title: pool
  abstract: 'pool: Object Pooling'
  notes: Imports
  url: http://rstudio.github.io/pool/
  repository: https://CRAN.R-project.org/package=pool
  authors:
  - family-names: Cheng
    given-names: Joe
    email: joe@posit.co
  - family-names: Borges
    given-names: Barbara
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  year: '2024'
- type: software
  title: REDCapR
  abstract: 'REDCapR: Interaction Between R and REDCap'
  notes: Imports
  url: https://ouhscbbmc.github.io/REDCapR/
  repository: https://CRAN.R-project.org/package=REDCapR
  authors:
  - family-names: Beasley
    given-names: Will
    email: wibeasley@hotmail.com
    orcid: https://orcid.org/0000-0002-5613-5006
  year: '2024'
- type: software
  title: RMySQL
  abstract: 'RMySQL: Database Interface and ''MySQL'' Driver for R'
  notes: Imports
  url: https://downloads.mariadb.org/connector-c/
  repository: https://CRAN.R-project.org/package=RMySQL
  authors:
  - family-names: Ooms
    given-names: Jeroen
    email: jeroen@berkeley.edu
    orcid: https://orcid.org/0000-0002-4035-0289
  - family-names: James
    given-names: David
  - family-names: DebRoy
    given-names: Saikat
  - family-names: Wickham
    given-names: Hadley
    email: hadley@rstudio.com
  - family-names: Horner
    given-names: Jeffrey
  year: '2024'
- type: software
  title: DiagrammeR
  abstract: 'DiagrammeR: Graph/Network Visualization'
  notes: Suggests
  url: https://rich-iannone.github.io/DiagrammeR/
  repository: https://CRAN.R-project.org/package=DiagrammeR
  authors:
  - family-names: Iannone
    given-names: Richard
    email: riannone@me.com
    orcid: https://orcid.org/0000-0003-3925-190X
  - family-names: Roy
    given-names: Olivier
    email: olivierroy71@hotmail.com
  year: '2024'
- type: software
  title: httptest
  abstract: 'httptest: A Test Environment for HTTP Requests'
  notes: Suggests
  url: https://enpiar.com/r/httptest/
  repository: https://CRAN.R-project.org/package=httptest
  authors:
  - family-names: Richardson
    given-names: Neal
    email: neal.p.richardson@gmail.com
    orcid: https://orcid.org/0009-0002-7992-3520
  year: '2024'
- type: software
  title: knitr
  abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
  notes: Suggests
  url: https://yihui.org/knitr/
  repository: https://CRAN.R-project.org/package=knitr
  authors:
  - family-names: Xie
    given-names: Yihui
    email: xie@yihui.name
    orcid: https://orcid.org/0000-0003-0645-5666
  year: '2024'
- type: software
  title: rmarkdown
  abstract: 'rmarkdown: Dynamic Documents for R'
  notes: Suggests
  url: https://pkgs.rstudio.com/rmarkdown/
  repository: https://CRAN.R-project.org/package=rmarkdown
  authors:
  - family-names: Allaire
    given-names: JJ
    email: jj@posit.co
  - family-names: Xie
    given-names: Yihui
    email: xie@yihui.name
    orcid: https://orcid.org/0000-0003-0645-5666
  - family-names: Dervieux
    given-names: Christophe
    email: cderv@posit.co
    orcid: https://orcid.org/0000-0003-4474-2498
  - family-names: McPherson
    given-names: Jonathan
    email: jonathan@posit.co
  - family-names: Luraschi
    given-names: Javier
  - family-names: Ushey
    given-names: Kevin
    email: kevin@posit.co
  - family-names: Atkins
    given-names: Aron
    email: aron@posit.co
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  - family-names: Cheng
    given-names: Joe
    email: joe@posit.co
  - family-names: Chang
    given-names: Winston
    email: winston@posit.co
  - family-names: Iannone
    given-names: Richard
    email: rich@posit.co
    orcid: https://orcid.org/0000-0003-3925-190X
  year: '2024'
- type: software
  title: testthat
  abstract: 'testthat: Unit Testing for R'
  notes: Suggests
  url: https://testthat.r-lib.org
  repository: https://CRAN.R-project.org/package=testthat
  authors:
  - family-names: Wickham
    given-names: Hadley
    email: hadley@posit.co
  year: '2024'
  version: '>= 3.0.0'
identifiers:
- type: url
  value: https://github.com/epiverse-trace/readepi/

GitHub Events

Total
  • Issues event: 2
  • Delete event: 5
  • Issue comment event: 2
  • Push event: 11
  • Pull request review event: 2
Last Year
  • Issues event: 2
  • Delete event: 5
  • Issue comment event: 2
  • Push event: 11
  • Pull request review event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 229
  • Total Committers: 9
  • Avg Commits per committer: 25.444
  • Development Distribution Score (DDS): 0.371
Past Year
  • Commits: 28
  • Committers: 4
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.214
Top Committers
Name Email Commits
Karim-Mane k****e@o****m 144
Hugo Gruson B****o 19
Thibaut Jombart t****t@g****m 18
GitHub Action a****n@g****m 18
Karim Mane k****e@i****l 17
Karim Mane k****e@L****l 8
banky 4****e 2
= d****t@a****a 2
Abdoelnaser M Degoot d****t@a****a 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 51
  • Total pull requests: 31
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 8
  • Total pull request authors: 5
  • Average comments per issue: 0.84
  • Average comments per pull request: 1.23
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Karim-Mane (21)
  • avallecam (10)
  • Bisaloo (8)
  • adamkucharski (4)
  • bahadzie (2)
  • pratikunterwegs (1)
  • avinashladdha (1)
  • wibeasley (1)
Pull Request Authors
  • Karim-Mane (22)
  • Bisaloo (12)
  • Degoot-AM (3)
  • bahadzie (2)
  • pitmonticone (1)
Top Labels
Issue Labels
enhancement (13) help wanted (3) Full review (1) documentation (1)
Pull Request Labels
documentation (2) bug (2) enhancement (2)

Dependencies

DESCRIPTION cran
  • checkmate * imports
  • covr * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/render_readme.yml actions
  • actions/checkout v2 composite
  • ad-m/github-push-action master composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite