Skip to contents

Clean and format the output table returned from the WFHZ plausibility check for improved clarity and readability. It converts scientific notations to standard notations, round values and rename columns to meaningful names.

Usage

mw_neat_output_wfhz(df)

Arguments

df

An object of class data.frame returned by this package's plausibility checker for WFHZ data, containing the summarized results to be formatted.

Value

A data.frame 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>, …