Skip to content

Commit

Permalink
update readme and vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
Karim-Mane committed Sep 29, 2023
1 parent 06019ca commit b9c9cff
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Imports:
Suggests:
bookdown,
httptest,
kableExtra,
knitr,
rmarkdown,
testthat (>= 3.0.0)
Expand Down
3 changes: 3 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
output: github_document
editor_options:
markdown:
wrap: 72
---

<!-- README.md is generated from README.Rmd. Please edit that file. -->
Expand Down
37 changes: 15 additions & 22 deletions vignettes/readepi.Rmd
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
---
title: "readepi: Reading data from health information systems"
output:
bookdown::html_vignette2:
fig_caption: yes
code_folding: show
pkgdown:
as_is: false
output:
rmarkdown::html_vignette:
df_print: "kable"
vignette: >
%\VignetteIndexEntry{Reading data from health information systems}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk[["set"]](collapse = TRUE, comment = "#>", eval = FALSE,
fig.width = 7L, fig.height = 7L, message = FALSE,
fig.align = "center", warning = FALSE, dpi = 300L)
row_id <- group_id <- NULL
```

# Overview

Health-related data in general, and epidemiological data in particular, are stored in files, relation database management systems (RDBMS), or health information systems (HIS). Each category includes numerous options, such as various file formats, RDBMS types, and HIS APIs. Import data from such repositories involve the usage of different format-specific functions or API-specific packages, which is an exhausting task for end users.
Expand All @@ -20,18 +24,7 @@ The main objective of **{readepi}** package is to simplify the process of readin

The current implementation of **{readepi}** provides a function for reading data from three common HIS: ([REDCap](https://www.project-redcap.org/), [DHIS2](https://dhis2.org/), and [Fingertips](https://fingertips.phe.org.uk/)), and RDBMS such as MS SQL, MySQL, and PostgreSQL. Other utility functions for processing and manipulating the imported data, such as row or column/row sub-setting, are also included in this package.


```{r, include = FALSE}
knitr::opts_chunk[["set"]](
collapse = TRUE,
comment = "#>",
message = FALSE,
warning = FALSE,
dpi = 300L
)
```

```{r setup}
```{r setup, eval=TRUE}
# LOAD readepi
library("readepi") # nolint
```
Expand Down Expand Up @@ -144,7 +137,7 @@ This credential (tab-delimited) file must contain the following columns:

To see the structure of a toy credentials file used as a template in the **{readepi}** package, use the `show_example_file()` function as shown below.

```{r eval=FALSE}
```{r eval=TRUE}
# DISPLAY THE STRUCTURE OF THE TEMPLATE CREDENTIALS FILE
show_example_file()
```
Expand All @@ -153,7 +146,7 @@ show_example_file()

This section contains various examples demonstrating how **{readepi}** imports data from databases. We assume that the credentials are stored in a file as explained above. Furthermore, these examples are based on a MySQL server that does not need the user to supply the `driver name`.

```{r eval=FALSE}
```{r eval=TRUE}
# DEFINING THE PATH TO THE TEMPLATE CREDENTIALS FILE
credentials_file <- system.file("extdata", "test.ini", package = "readepi")
```
Expand All @@ -162,7 +155,7 @@ credentials_file <- system.file("extdata", "test.ini", package = "readepi")

To display list of tables from a database of interest, use:

```{r eval=FALSE}
```{r eval=TRUE}
show_tables(
data_source = "mysql-rfam-public.ebi.ac.uk",
credentials_file = credentials_file,
Expand All @@ -179,7 +172,7 @@ When importing data from **MS SQL, MySQL and PostgreSQL servers**, the user need
- `driver_name`: the name of the MS driver (only for MS SQL servers).
- `from`: the name of the table from which the data will be fetched. This can also be the SQL query to be used for fetching data from the system.

```{r eval=FALSE}
```{r eval=TRUE}
# VISUALIZING THE FIRST 5 ROWS OF THE TABLE 'author'
visualise_table(
data_source = "mysql-rfam-public.ebi.ac.uk",
Expand Down

0 comments on commit b9c9cff

Please sign in to comment.