TimTaylor / ageutils

Utility functions for working with individual ages and intervals
https://timtaylor.github.io/ageutils
GNU General Public License v2.0
3 stars 0 forks source link

Confusing/misleading/erroneous error message #5

Closed TimTaylor closed 3 weeks ago

TimTaylor commented 6 months ago
ageutils::reaggregate_interval_counts(
    lower_bounds = 0:100,
    upper_bounds = c(1:100, Inf),
    counts = runif(101, 100, 1000),
    max_upper = 100,
    breaks = c(0, 10, 50)
)
#> Warning in ageutils::reaggregate_interval_counts(lower_bounds = 0:100,
#> upper_bounds = c(1:100, : `upper_bounds` greater than `max_upper` (100) have
#> been replaced prior to splitting.
#> Error in ageutils::reaggregate_interval_counts(lower_bounds = 0:100, upper_bounds = c(1:100, : `lower_bounds` must be less than `upper_bounds`.

Created on 2024-03-25 with reprex v2.1.0

TimTaylor commented 6 months ago

Patching with the following alternative:

ageutils::reaggregate_interval_counts(
    lower_bounds = 0:100,
    upper_bounds = c(1:100, Inf),
    counts = runif(101, 100, 1000),
    max_upper = 100,
    breaks = c(0, 10, 50)
)
#> Error in ageutils::reaggregate_interval_counts(lower_bounds = 0:100, upper_bounds = c(1:100, : 
    `max_upper` must be greater than all `lower_bounds`.

Leaving this open though as want to improve this before 0.1.0 release

TimTaylor commented 3 weeks ago

Closing as function deprecated in latest (0.0.5) release.