forked from eth-mds/ricu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
97 lines (71 loc) · 3.53 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
output:
github_document:
html_preview: false
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE, results = "asis", comment = ""}
options(crayon.enabled = TRUE)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(ricu)
old.hooks <- fansi::set_knit_hooks(knitr::knit_hooks)
```
# [ricu](https://eth-mds.github.io/ricu/)
<!-- badges: start -->
[![Lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![CRAN](https://www.r-pkg.org/badges/version/ricu)](https://cran.r-project.org/package=ricu)
[![R build status](https://github.com/eth-mds/ricu/workflows/check/badge.svg)](https://github.com/eth-mds/ricu/actions?query=workflow%3Acheck)
[![pkgdown build status](https://github.com/eth-mds/ricu/workflows/pkgdown/badge.svg)](https://github.com/eth-mds/ricu/actions?query=workflow%3Apkgdown)
[![covr status](https://github.com/eth-mds/ricu/workflows/coverage/badge.svg)](https://github.com/eth-mds/ricu/actions?query=workflow%3Acoverage)
[![Codecov test coverage](https://codecov.io/gh/eth-mds/ricu/branch/main/graph/badge.svg?token=gQisoami9F)](https://app.codecov.io/gh/eth-mds/ricu)
<!-- badges: end -->
Working with ICU datasets, especially with publicly available ones as provided by [PhysioNet](https://physionet.org) in R is facilitated by `ricu`, which provides data access, a level of abstraction to encode clinical concepts in a data source agnostic way, as well as classes and utilities for working with the arising types of time series datasets.
## Installation
Currently, installation is only possible from github directly, using the `remotes` if installed
```{r gh-rem, eval = FALSE}
remotes::install_github("eth-mds/ricu")
```
or by sourcing the required code for installation from github by running
```{r gh-dir, eval = FALSE}
rem <- source(
paste0("https://raw.githubusercontent.com/r-lib/remotes/main/",
"install-github.R")
)
rem$value("eth-mds/ricu")
```
In order to make sure that some useful utility packages are installed as well, consider installing the packages marked as `Suggests` as well by running
```{r gh-all, eval = FALSE}
remotes::install_github("eth-mds/ricu", dependencies = TRUE)
```
instead, or by installing some of the utility packages (relevant for downloading and preprocessing PhysioNet datasets)
```{r deps-util, eval = FALSE}
install.packages("xml2")
```
and demo dataset packages
```{r deps-data, eval = FALSE}
install.packages(c("mimic.demo", "eicu.demo"),
repos = "https://eth-mds.github.io/physionet-demo")
```
explicitly.
## Data access
Out of the box (provided the two data packages `mimic.demo` and `eicu.demo` are available), `ricu` provides access to the demo datasets corresponding to the PhysioNet Clinical Databases eICU and MIMIC-III. Tables are available as
```{r mimic-adm}
mimic_demo$admissions
```
and data can be loaded into an R session for example using
```{r mimic-ts}
load_ts("labevents", "mimic_demo", itemid == 50862L,
cols = c("valuenum", "valueuom"))
```
```{r mimic-ts-print, echo = FALSE}
load_ts("labevents", "mimic_demo", itemid == 50862L,
cols = c("valuenum", "valueuom"))[]
```
which returns time series data as `ts_tbl` object.
## Acknowledgments
This work was supported by grant #2017-110 of the Strategic Focal Area "Personalized Health and Related Technologies (PHRT)" of the ETH Domain for the SPHN/PHRT Driver Project "Personalized Swiss Sepsis Study".