Skip to contents

misc.debris 1.0.0

Breaking changes

  • mode() has been renamed stats_mode(). The old name masked base::mode(). Update any calls to the new name; mode() is no longer exported.

  • get_weather_list() now returns NULL for a station whose data could not be fetched, and reports the reason as a message. Previously that element was the character string “Error in acquiring weather data for this station.”.

  • get_weather_list() now names each list element using the first row of station_name (previously the second row), falling back to the station code when no data were returned.

  • check_oz_lonlat() now accepts latitudes from -43.7 to -9 (previously -43.5 to -10), so locations in southern Tasmania and the Torres Strait are no longer rejected.

New features

  • stats_mode() gains an na.rm argument, TRUE by default, so that missing values can be removed or counted explicitly.

  • check_oz_lonlat() is now vectorised. When any value is outside Australia, the error reports only the offending values.

  • check_date_seq() now also warns when dates are unsorted or duplicated, and errors on empty input or NA dates.

  • create_climograph() now errors with a message naming any missing columns (date, rainfall, air_tmin, air_tmax) and when air_tmin or air_tmax contain no non-missing values.

Bug fixes

  • stats_mode() no longer errors for vectors with more than one element in R >= 4.3 because of an invalid || condition on the input check.

  • stats_mode() now works for character, logical, integer and Date input and returns values of the same type. Previously values were coerced with as.numeric(), giving NA for character input and losing precision for some doubles. It also gives a clearer error when x does not exist.

  • check_date_seq() no longer errors with “object ‘location’ not found” when y = NULL, and no longer gives a misleading warning for unsorted or duplicated dates.

  • check_oz_lonlat() now gives informative errors for NA, empty and non-numeric input instead of failing in if().

  • create_climograph() no longer divides by zero when there is no rainfall or when minimum and maximum temperature are equal.

  • get_weather_list() no longer fails when one station cannot be fetched or returns a single row, which previously broke the naming of the whole list.

Minor improvements

  • rle2() is faster, now running in linear time, and no longer relies on {lubridate}. Results are unchanged. It errors if x and index have different lengths.

  • get_weather_list() now checks that at least one station and two non-missing API keys are supplied, and .get_weatherOz() rejects NA or multi-element station codes.

  • Documentation corrections: rle2() compares with >= and returns the columns index, value and test; create_climograph() plots precipitation on the left axis and temperature on the right; check_date_seq() and check_oz_lonlat() describe what they return and when they warn or error.

  • Expanded the test suite for all of the above.

misc.debris 0.1.3

Bug Fixes

  • Fixes bug in rle2() examples where DPIRD colours were not available.

  • Fixes bug in check_oz_lonlat() that didn’t use {cli} for error messages.

  • Fixes bug in check_oz_lonlat() that didn’t return the incorrect lon or lat values provided by the user in the error message.

Minor Changes

  • Uses Bootstrap 5 in {pkgdown} site.

  • Adds URLs to DESCRIPTION file.

  • Uses {cli} for messages and errors.

misc.debris 0.1.2

Minor Changes

  • Add examples to all functions that detail more than one option where applicable.

  • Upgrades test infrastructure.

Bug Changes

  • Fixes documentation where several examples were broken.

  • Fixes bug in get_weather_list() that caused the function to fail.

  • Import missing {data.table} functionality.

misc.debris 0.1.1