-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
55 lines (47 loc) · 1.66 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
---
output: github_document
---
<!--
rmarkdown::render("README.Rmd")
#-->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
library(nhds)
library(icd, quietly = TRUE, warn.conflicts = FALSE)
```
# nhds
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/nhds)](https://CRAN.R-project.org/package=nhds)
[![Travis build status](https://travis-ci.org/jackwasey/nhds.svg?branch=master)](https://travis-ci.org/jackwasey/nhds)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/jackwasey/nhds?branch=master&svg=true)](https://ci.appveyor.com/project/jackwasey/nhds)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
<!-- badges: end -->
```{r pkgdesc, results = 'asis', echo = FALSE}
cat(packageDescription("nhds")$Description)
```
See documentation for the [R CRAN package: icd](https://jackwasey.github.io/icd/) for how to use this data. See also the [R CRAN package: icd.data](https://cran.r-project.org/package=icd.data).
# Examples
```{r examples}
nhds2010$hypertension <- icd::comorbid_ahrq(nhds2010)[, "HTN"]
nhds2010$charlson <- icd::charlson(nhds2010)
hist(nhds2010[nhds2010$age_unit == "years", "age"],
main = "Histogram of age when specified in years",
xlab = "Age in years"
)
boxplot(age ~ hypertension,
data = nhds2010,
outline = FALSE,
ylab = "Age")
boxplot(charlson ~ adm_type,
data = nhds2010,
las = 2,
varwidth = TRUE,
outline = FALSE,
ylab = "Charlson Score"
)
```