-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
60 lines (47 loc) · 1.89 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# whozr
<!-- badges: start -->
[![check-standard](https://github.com/simisc/whozr/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/simisc/whozr/actions/workflows/check-standard.yaml)
[![DOI](https://zenodo.org/badge/113995327.svg)](https://zenodo.org/badge/latestdoi/113995327)
[![Licence](https://img.shields.io/github/license/simisc/whozr)](https://github.com/simisc/whozr/blob/master/LICENSE)
[![Lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
[![codecov](https://codecov.io/gh/simisc/whozr/branch/master/graph/badge.svg?token=OTFYOOXEVC)](https://codecov.io/gh/simisc/whozr)
<!-- badges: end -->
Convert raw anthropometric measurement (weight, height, length, BMI, MUAC, head circumeference, tricep skinfold and subscapular skinfold) to z-scores, using the WHO growth standards (0-5 years) and/or references (5-19 years).
Also allows the 'reverse' calculation of original anthropometry measures from z-scores (requires further testing).
## Installation
You can install whozr from github with:
```{r gh-installation, eval = FALSE}
# install.packages("remotes")
remotes::install_github("simisc/whozr")
```
## Example
```{r message=FALSE, warning=FALSE}
library(dplyr) # tibble(), mutate()
library(knitr) # kable()
library(whozr) # zwa(), zla(), zwl()
```
```{r}
tibble(
sex = c("F", "M", "M", "F"),
age_days = c(120, 310, 370, 460),
weight_kg = c(5.98, 8.09, 8.40, 8.46),
length_cm = c(60.2, 70.7, 72.6, 74.9)
) |>
mutate(
waz = zwa(weight_kg, age_days, sex),
laz = zla(length_cm, age_days, sex),
wlz = zwl(weight_kg, length_cm, sex)
) |>
kable(digits = 3)
```