print.greensIndex: 'print()' helper function for 'print.greensIndex()' function

View source: R/greensIndex.R

print.greensIndexR Documentation

print() helper function for print.greensIndex() function

Description

print() helper function for print.greensIndex() function

Usage

## S3 method for class 'greensIndex'
print(x, ...)

Arguments

x

Object resulting from applying the greensIndex() function

...

Additional print() parameters

Value

Printed output of greensIndex() function

Examples

# Apply Green's Index using anthropometric data from a SMART survey in Sudan
# (flag.ex01)
svy <- flag.ex01
svy$flag <- 0
svy$flag <- ifelse(!is.na(svy$haz) & (svy$haz < -6 | svy$haz > 6), svy$flag + 1, svy$flag)
svy$flag <- ifelse(!is.na(svy$whz) & (svy$whz < -5 | svy$whz > 5), svy$flag + 2, svy$flag)
svy$flag <- ifelse(!is.na(svy$waz) & (svy$waz < -6 | svy$waz > 5), svy$flag + 4, svy$flag)
svy <- svy[svy$flag == 0, ]
svy$stunted <- ifelse(svy$haz < -2, 1, 2)
gi <- greensIndex(data = svy, psu = "psu", case = "stunted")
print(gi)


ernestguevarra/nipnTK documentation built on April 13, 2024, 1:48 p.m.