Add documentation and make rounding for correlation() explicit
#320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses comments made by review from the Journal of Statistical Software.
It
summarise_scores().correlation(). Previously, the function always rounded correlations to two digits. Instead, this PR introduces a new argument,digits(with the default set to 0, meaning that no rounding takes place).This is one possible proposal to handle the rounding and there may be other ways to do this. Here are some thoughts:
digits = NULLor something like that also feels slightly weird.digitsargument doesn't have to live incorrelation(). It could also e.g. live inplot_correlation(). I introduced it here for the following reasons:correlation()is a data.table with numeric and non-numeric columns (the metric names). Rounding them using only data.table code is clunky (I guess you can do something likedt[, lapply(.SD, round, 2), .SDcols = sapply(dt, is.numeric)], but then you still have to manually add back the metric names column).plot_correlations()at some point, then it seems cleaner to me to have the rounding incorrelation()rather than inplot_correlations().