Skip to contents

mcrutils 0.0.0.9017

Bug fixes

  • is_ytd_comparable() no longer excludes the final day of the window when date is a datetime. Only end_date was coerced to a date, so a POSIXct date was compared against a Date promoted to midnight and any timestamp later than 00:00:00 on the boundary day compared as later than the bound. A year-to-date filter built on a timestamp column therefore lost its last day, in every year. This contradicted the documented behaviour that the time component is ignored; both arguments are now coerced.

mcrutils 0.0.0.9016

Breaking

  • adjust_to_bizday()’s default convention is now "Preceding" (was "ModifiedPreceding"). Pass bdc = "ModifiedPreceding" to restore the previous behaviour.

    "ModifiedPreceding" cannot leave the input’s calendar month, so a month opening on a non-business day rolls forward onto that month’s first business day. "Preceding" rolls back unconditionally.

    This means the adjusted date’s period may differ from the input’s. Callers that index an adjusted date within a period must derive the period from the adjusted date, or a value can be filed under one period and numbered within another — see the bizday_of_period() example in vignette("mcrutils").

mcrutils 0.0.0.9015

New

Breaking

  • adjust_to_bizday()’s default convention is now "ModifiedPreceding" (was "Following"). Pass bdc = "Following" to restore the previous behaviour.

    Forward-rolling has two problems when the adjusted date is then indexed within a period. It can move a date out of its calendar month, and bizday_of_period() numbers whatever it is given from the start of that date’s period - so a period’s closing weekend lands on the next period’s first business day, while that period’s own closing weekend disappears. It is also inconsistent with a half-open upper bound (date < end): it moves in-scope dates onto end, a date the caller excluded, producing a business day with no data behind it. A preceding-leaning, month-safe convention avoids both, and since every quarter and year boundary is also a month boundary it holds for those periods too.

mcrutils 0.0.0.9014

New

Behavior changes

  • most_recent_monday() / most_recent_sunday(): the ref_date argument is renamed as_of, matching the period-completeness functions (both name the date that state is evaluated as of). The default (current date) is unchanged and positional calls are unaffected, but callers passing ref_date = by name must switch to as_of =.

mcrutils 0.0.0.9013

Behavior changes

mcrutils 0.0.0.9012

Bug fixes

mcrutils 0.0.0.9011

New

mcrutils 0.0.0.9010

New

  • mutate_cagrs() to compute compound annual growth rates (CAGRs) for specified columns in a data frame.
  • passed_colnames(), a helper function that evaluates a tidyselect expression in the context of a data frame and returns the names of the columns that were selected.

mcrutils 0.0.0.9009

New

mcrutils 0.0.0.9008

New

  • bizday_of_period() to compute the business day of a date within a given period (e.g. date xxx is the 3rd business day of the month according to the UnitedStates QuantLib calendar)

  • is_bizday(), bizdays_between() which wrap similar qlcal functions, but allow evaluation in a specified QuantLib calendar without making persistent changes to the globally configured calendar.

  • with_calendar() and local_calendar() which facilitate temporary changes to the configured qlcal QuantLib calendar a’la with_*() and local_*() functions from the withr package.

  • set_calendar() which changes the globally configured qlcal QuantLib calendar, but only if the specified calendar is valid and different from the currently configured calendar.

Changed

  • (internal) removed bizdays dependency, now using qlcal for business day functions

mcrutils 0.0.0.9007

New

  • periodic_bizdays() function to calculate business days between two dates with a specified periodicity (e.g., weekly, monthly), using RQuantLib calendars for holiday definitions. A convenience wrapper around bizdays::bizdays()

mcrutils 0.0.0.9006

New

  • plot_accounts_by_status() can now display lost accounts in two ways. Default behavior lost = "detailed" shows temporarily_lost and termially_lost separately (as in prior versions), while lost = "simple" combines them into a single lost category.

Changed

  • auto_dt() now includes copy and download buttons by default. Set buttons = FALSE to suppress