Skip to contents

scicalc 0.4.0

New features

  • Categorical mapping functions are now configurable through options:
    • racen() recognizes six race categories (white, black, asian, american native, pacific islander, other/multiple). Set options(scicalc.racen_config = ) to a named numeric vector to override any category’s code and to add novel categories (matched before the built-ins).
    • agec() and bmic() accept fully custom bands via options(scicalc.agec_config = ) / options(scicalc.bmic_config = ) — a data frame with label, min (lower bound), and code columns that replaces the FDA/WHO defaults. Bands are half-open [min, next min) with an open-ended top band.
    • Any active configuration is listed in the package startup message.
  • Added is_missing_value(), a predicate for the missing-value sentinel (getOption("scicalc.missing_value"), default -999), e.g. dplyr::filter(df, !is_missing_value(x)).
  • Calculation functions now handle the missing-value sentinel in their inputs: a sentinel value is treated as missing during the computation and the sentinel is preserved in the result.
  • read_file_with_hash() and read_hashed_file() gained a reader argument for file types they don’t natively support (e.g. reader = arrow::read_feather); write_file_with_hash() gained a matching writer argument. For a known extension the custom function is ignored unless force = TRUE.

Bug fixes

  • egfr(): pass method by name; positional args are sexf, raceb, age, creat, cystc, height. Passing a method string positionally now errors instead of silently defaulting.
  • rfc() now honors an explicitly-supplied absolute_units; the estimator’s scicalc_units attribute is used only as a fallback when absolute_units is not given.
  • write_csv_with_hash() and write_parquet_with_hash() were filtering ... against the wrong function’s arguments (read_csv()/read_parquet() instead of write_csv()/write_parquet()), silently dropping valid writer arguments like eol or compression.

Changes

scicalc 0.3.0

New features

  • Added aegfr() function to convert relative eGFR (mL/min/1.73m^2) to absolute eGFR (mL/min).
  • Added ibw() (ideal body weight) and aibw() (adjusted ideal body weight) functions.
  • Added bmic() (BMI category) function.
  • Added agec() (age category) function.
  • Added cor_df() function that takes a dataframe and a vector of column names to compute all pairwise correlations.
  • Added is_female() and is_black() helper functions for converting character sex/race to logical values.
  • Added unit conversion functions: convert_creat(), convert_bili(), convert_alb().
  • Added round_like() function to round numeric values based on explicit or inferred significant digits from a reference value. (Experimental, API may change.)

Improvements

  • Computed quantities now include a units attribute for unit tracking:
  • Category functions now include a category_standard attribute:
  • rfc() can now infer absolute_units from the input’s units attribute, allowing rfc(AEGFR) to work directly without specifying units.
  • Updated egfr() equation default to use CKDEPI 2021 equation.
  • Default hash algorithm changed from md5 to blake3 for read_file_with_hash() and related functions.
  • Added recycling warning to all functions when inputs have different lengths.

scicalc 0.2.1

  • Fixed edge case handling for hfc when bilirubin is exactly equal to the cut-off values of 1.5 or 3 times ULN

scicalc 0.2.0

  • Added a NEWS.md file to track changes to the package.