check_data: Check a dataset to ensure it will be compatible with hbgd...

Description Usage Arguments Examples

View source: R/check_data.R

Description

Check a dataset to ensure it will be compatible with hbgd methods

Usage

1
check_data(dat, has_height = TRUE, has_weight = TRUE, has_hcir = TRUE)

Arguments

dat

a data frame

has_height

does this dataset contain anthropometric height data?

has_weight

does this dataset contain anthropometric weight data?

has_hcir

does this dataset contain anthropometric head circumference data?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(growthstandards)
check_data(cpp, has_hcir = FALSE)

smc <- brokenstick::smocc.hgtwgt
check_data(smc, has_hcir = FALSE)

names(smc)[2] <- "subjid"
names(smc)[5] <- "agedays"
smc$sex <- as.character(smc$sex)
smc$sex[smc$sex == "male"] <- "Male"
smc$sex[smc$sex == "female"] <- "Female"
names(smc)[10] <- "htcm"
names(smc)[11] <- "wtkg"

check_data(smc, has_hcir = FALSE)

names(smc)[12] <- "haz"
smc$waz <- who_wtkg2zscore(smc$agedays, smc$wtkg, smc$sex)
smc$agedays <- smc$agedays * 365.25

check_data(smc, has_hcir = FALSE)

hafen/hbgd documentation built on March 1, 2020, 5:31 p.m.