-
Notifications
You must be signed in to change notification settings - Fork 25
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
Error on empty data.frames #23
Comments
Thanks for the feedback @petermeissner. I agree there's no reason why it needs to be this way, in fact, I can think of example where this could be frustrating if people are running a long piece of R code and are expecting to find a dataCompareR output at the end, only to have an error because one data.frame is empty. I don't think this should be that difficult to change, so will look to change the behaviour in the next update. Note that we're just about to merge dev > master and update the CRAN package to fix a few of the |
I'm curious on what the original reasoning was in including the check for empty data frames as part of validating the data before comparison, and what comparison functions might break if the |
Good question - we generally went with the approach of validating the data passed to Based on the code-base and the most useful experience for users, I'd probably suggest:
In either case I'd like to ensure we produce valid output objects where possible - in the longer term, I'd like to work on #8, and so avoiding bespoke output in these scenarios will help a lot! |
Working on this now - bit harder than I expected, as follows:
I dislike this message - it is unclear. and for summary
The line And I'm struggling to see how this can be interpreted!
|
Picking them up one by one, the line |
After some work,
|
However, I do not like the
|
When comparisons happen,
or
|
Modified the code so that the current unit tests pass and we get
|
Hey,
thnaks for the package this is very use ful and very handy - we love the summary and the reporting!
What irritates me is the following:
I have two data.frames, e.g.:
Obviously this is not a bug but intended behaviour (right?) BUT I would argue that
I would suggest to either redesign the function to make it handle 0 row data.frames just like any other data.frame or allow the user to prevent this error by setting a parameter (e.g.:
rCompare(df_1, df_2, do_not_error_on_emty_df = TRUE)
).What do you think?
The text was updated successfully, but these errors were encountered: