diffdf
diffdf copied to clipboard
Idea: Move nice to have options to a config object
This would help prevent overloading the options available for diffdf and get newer users to just focus on the important options
I think we should test this and see how it looks, but in principle it's fine. I think the challenge in documenting this well is just in the rd files. Ideally in this kind of situation I think I'd like to make a spoof rd file but I think that's tricky in R.
Yeah so I think given all the potential enchancements this will become important. Documenting this will be important, need to look at how caret and other packages do this, I often find it quite difficult to work out what options are available when packages do this, so we need to try to be explicit.
One idea would be to have a function diffdf_options() which generates a list passed to diffdf, then we can fully document all options there. So the default would be something like
diffdf(..., config = diffdf_options())
which uses the default options, then the user can update as they need to.
If we go with this options we need to think carefully about which options should be hidden and which should be available in the core function
@kieranjmartin ,
How do you feel to the idea of just moving every option to the config object ? One nice thing about this is that if a user has to do multiple comparisons as part of their checks then they only need to define this once.
config <- diffdf_config(
tolerance = 0.0002,
scale = 1,
warnings = TRUE,
check_row_order = TRUE,
check_column_order = FALSE,
)
diffdf( asl , qc_asl, config)
diffdf( alb, qc_alb, config)
diffdf( avs, qc_avs, config)
EDIT:
A common place where this is done is under grid::gpar
maybe to keep the syntax concise could call it dpar
or dfpar
?