-
Notifications
You must be signed in to change notification settings - Fork 8
Ignore NA
s when printing an archive's min/max time_value
#156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks, I like the described behavior. Implementation-wise, I'm not sure if the warning message could vary between different versions of R [so the current check might be brittle]. (+ pattern-wise we might want to keep a habit of using |
Not sure if I was too afraid of "brittleness" above. Slight tweak to the current logic to get it closer to how the warning is triggered:
Side note from testing: we can't directly construct an epi_archive with all-NaN time_values, although I see no use cases for this. as_epi_archive(tibble::tibble(geo_value=1,time_value=NaN,version=1,value=1))
#> Error in if (is.numeric(time_value) && all(time_value == as.integer(time_value)) && (from utils.R#93) :
#> missing value where TRUE/FALSE needed I do see a use case for all-NA time values in an epi_archive, to provide version tracking for non-time-series data (or maybe time series in a |
To clarify in case we revisit this thread: we are currently able to directly construct an epi_archive with all NA |
Thanks for the fix.
In my testing, it seems that we can. The problem with construction is that the
but if we set |
Description
Toggle on the
na.rm
option (via the customMin
andMax
functions) so even if anepi_archive
'stime_value
field contains some missing values (NA
) printed min/max values are still useful. PrintsNA
if alltime_value
s are missing and "no non-missing arguments" warning is raised, or if an un-caught warning occurs.Changes
R/archive.R
- addedna.rm
setting and try-catch to handle all-missing case.man/as_epi_df.Rd
- not my changes, showed up when I re-document()
edFixes
Closes #106