Skip to content

v0.0.3

Latest

Choose a tag to compare

@stufield stufield released this 28 Sep 14:50

wranglr 0.0.3

Breaking changes

  • create_sumry_tbl() now returns Q25 and Q75 columns in place of the
    IQR column. The quartiles do not assume a symmetric distribution. To get
    the old value, use Q75 - Q25.

  • create_sumry_tbl() now returns the count of non-missing values in n,
    and the count of all values in the new total_n column. n and NAs now
    sum to total_n. If you used n as the total count, use total_n.

  • imputeNAs() is now impute_median(). Its behaviour does not change.
    Replace all calls to imputeNAs() with impute_median().

  • impute_predictors() is now defunct and gives an error when you call it,
    it will be fully deprecated/removed in future versions.

New features

  • New impute_missing() replaces NA values in a numeric vector with random
    draws from a fitted distribution. It estimates the distribution parameters
    with maximum likelihood. distr selects a Gaussian ("norm", the default),
    Gamma ("gamma"), or Beta ("beta") distribution, and seed makes the
    draws reproducible.

    x <- rnorm(10, mean = 10, sd = 5)
    x[c(2, 7)] <- NA_real_
    impute_missing(x)                   # Gaussian
    impute_missing(abs(x), "gamma")     # Gamma

Minor improvements and fixes

  • create_sumry_tbl() now returns Q25 and Q75 columns in place of IQR,
    and a new total_n column. n now counts only non-missing values.

  • create_sumry_tbl() now keeps the class and level order of the first
    grouping column if it is a factor. The "Total" row is the last level.
    Other column types become character, so numeric grouping columns, such
    as cyl in mtcars, now work without conversion to a factor.

  • create_sumry_tbl() now returns NA for all statistics (except total_n,
    NAs, and n) when all values of var are missing, instead of an error.