Skip to content

Commit

Permalink
point users to vignette("rounding-options")
Browse files Browse the repository at this point in the history
  • Loading branch information
lhdjung committed Feb 16, 2024
1 parent 7d29655 commit c5327c0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# scrutiny (development version)

Major performance improvements. Furthermore:
This version brings major performance improvements. Furthermore:

## Bugfixes

- Fixed a bug in `audit_seq()`: If the `dispersion` argument in the preceding call to a function like `grim_map_seq()` was specified as something other than a linearly increasing sequence, the `"diff_*"` columns in the data frames returned by `audit_seq()` may have contained incorrect values.
- Similarly, `audit_seq()` and `reverse_map_seq()` used to reconstruct the reported values incorrectly if the `dispersion` default was overridden as described above. At least for now, the issue is handled by throwing an error if these functions operate on data frames that are the result of specifying `dispersion` as something other than a linearly increasing sequence.
- Fixed a bug that incorrectly threw an error in `grim_map_seq()`, other functions made by `function_map_seq()`, as well as `seq_disperse()` and `seq_disperse_df()` if an input value was so close to `out_min` or `out_max` that the output sequence would be shorter than implied by `dispersion` / `.dispersion` , and if `track_var_change` / `.track_var_change` (see below) was `TRUE`. Again, note that the bug only occurred if an error was thrown.

## Minor improvements
## New features

- A new vignette lists the options for specifying the `rounding` argument that many scrutiny functions have: `vignette("rounding-options")`.
- The output of `grim_map_seq()`, `grimmer_map_seq()`, `debit_map_seq()` and any other function made by `function_map_seq()` now has a `diff_var` column that tracks the difference between the dispersed variable (see the `var` column) and the reported value. Following the `diff_*` columns in the output of `audit_seq()`, this is the number of dispersion steps, not the actual numeric difference.
- The same `diff_*` columns are now integer, not double.
- `function_map()`, `function_map_seq()`, and `function_map_total_n()` have a new `.name_key_result` argument that controls the name of the key result column in the output of the factory-made function. This is `"consistency"` by default, but other names will fit better for other kinds of tests. (The results of these tests must still be logical values.)
Expand Down
5 changes: 2 additions & 3 deletions R/grim-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@
#'
#' With `grim_map()`'s default for `rounding`, `"up_or_down"`, strikingly few
#' values are flagged as inconsistent for sample sizes 40 and 80 (or 4 and 8).
#' This effect disappears if `rounding` is set to any other value. For a list
#' of values that `rounding` can take, see documentation for `grim()`, section
#' `Rounding`.
#' This effect disappears if `rounding` is set to any other value (see
#' `vignette("rounding-options")`).
#'
#' The 4/8 leniency effect arises because accepting values rounded either up
#' or down is more careful and conservative than any other rounding procedure.
Expand Down
7 changes: 3 additions & 4 deletions R/reround.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ reconstruct_rounded_numbers_scalar <- function(x, digits, rounding,
cli::cli_abort(c(
"`rounding` must be one of the designated string values.",
"x" = "It was given as {wrong_spec_string(rounding)}.",
"i" = "See documentation for `grim()`, section `Rounding`."
"i" = "See `vignette(\"rounding-options\")`."
))
)
}
Expand Down Expand Up @@ -84,9 +84,8 @@ reconstruct_rounded_numbers <- Vectorize(reconstruct_rounded_numbers_scalar,
#' (i.e., mean or percentage within `grim()`, or standard deviation within
#' `debit()`).
#' @param rounding String. The rounding method that is supposed to have been
#' used originally. See documentation for `grim()`, section `Rounding`.
#' Default is `"up_or_down"`, which returns two values: `x` rounded up *and*
#' down.
#' used originally. See `vignette("rounding-options")`. Default is
#' `"up_or_down"`, which returns two values: `x` rounded up *and* down.
#' @param threshold Integer. If `rounding` is set to `"up_from"`, `"down_from"`,
#' or `"up_from_or_down_from"`, `threshold` must be set to the number from
#' which the reconstructed values should then be rounded up or down. Otherwise
Expand Down
5 changes: 2 additions & 3 deletions man/grim_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions man/reround.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c5327c0

Please sign in to comment.