Use internal checking function to reduce duplication#161
Use internal checking function to reduce duplication#161
Conversation
|
Thanks. Will review and merge into the latest 0.1.2 release PR #168 is complete (as seems like this is probably best sequence given CRAN submission was in limbo while this PR was added). |
adamkucharski
left a comment
There was a problem hiding this comment.
I've reviewed these changes with a mis-specified data input column, i.e. ebola1976_first_30 <- rename(ebola1976_first_30,dates=date) and found the following issue:
The original check format stops at the assert_names step with an informative warning, preventing any further checks being evaluated:
checkmate::assert_names(
colnames(data),
must.include = c("date", "cases", "deaths")
)
Error: Assertion on 'colnames(data)' failed: Names must include the elements {'date','cases','deaths'}, but is missing elements {'date'}.However, the new function seems to hit an error because it stores the output of this check along the way, but then reaches the assert_data_frame check, which can't be completed:
.check_input_data(data)
Error in `[.data.frame`(data, , c("date", "cases", "deaths")) :
undefined columns selected|
I see two potential fixes:
What would you prefer? |
|
Hi @adamkucharski, do you see value in this? If so, I'd welcome your input on the question above, so I can finalize this PR and get it ready to be merged. If not, I will close this PR and delete this branch. |
|
I won't have time to review this week, so fine to just include 734df58 (#161) if no errors here. |
80f57ea to
a495062
Compare
a495062 to
fcffb72
Compare
cfr_()function