| reduce_rows | R Documentation |
Often a bug only shows up with a large data frame, even though a handful of
rows is enough to trigger it. reduce_rows() applies ddmin() over the rows
of data and returns the smallest subset for which predicate still holds,
preserving the original row order. The result is typically small enough to
paste into a bug report with dput().
reduce_rows(
data,
predicate,
algorithm = c("cdd", "ddmin"),
max_oracle_calls = Inf,
verbose = FALSE
)
data |
A data frame. |
predicate |
A function taking a data frame (a subset of |
algorithm |
Character. The reduction strategy for the first phase, one
of |
max_oracle_calls |
Numeric. An upper bound on the number of predicate
calls. Passed through to |
verbose |
Logical. If |
A data frame containing the one-minimal subset of rows.
ddmin(), minex().
df <- data.frame(id = 1:6, value = c(3, 8, 999, 2, 5, 7))
# The failure: any value greater than 100.
reduce_rows(df, function(d) any(d$value > 100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.