Clean and format the output tibble returned from the WFHZ plausibility check
Source:R/plausibility_check_wfhz.R
mw_neat_output_wfhz.Rd
Converts scientific notations to standard notations, rounds off values, and renames columns to meaningful names.
Arguments
- df
An
tibble
object returned by themw_plausibility_check_wfhz()
containing the summarized results to be formatted.
Value
A tibble
object of the same length and width as df
, with column names and
values formatted for clarity and readability.
Examples
## First wrangle age data ----
data <- mw_wrangle_age(
df = anthro.01,
dos = dos,
dob = dob,
age = age,
.decimals = 2
)
## Then wrangle WFHZ data ----
data_wfhz <- mw_wrangle_wfhz(
df = data,
sex = sex,
weight = weight,
height = height,
.recode_sex = TRUE
)
#> ================================================================================
## Now run the plausibility check ----
pl <- mw_plausibility_check_wfhz(
df = data_wfhz,
sex = sex,
age = age,
weight = weight,
height = height,
flags = flag_wfhz
)
## Now neat the output table ----
mw_neat_output_wfhz(df = pl)
#> # A tibble: 1 × 19
#> `Total children` `Flagged data (%)` `Class. of flagged data` `Sex ratio (p)`
#> <int> <chr> <fct> <chr>
#> 1 1191 1.0% Excellent 0.297
#> # ℹ 15 more variables: `Class. of sex ratio` <chr>, `Age ratio (p)` <chr>,
#> # `Class. of age ratio` <chr>, `DPS weight (#)` <dbl>,
#> # `Class. DPS weight` <chr>, `DPS height (#)` <dbl>,
#> # `Class. DPS height` <chr>, `Standard Dev* (#)` <dbl>,
#> # `Class. of standard dev` <chr>, `Skewness* (#)` <dbl>,
#> # `Class. of skewness` <fct>, `Kurtosis* (#)` <dbl>,
#> # `Class. of kurtosis` <fct>, `Overall score` <dbl>, …