Later dplyr and tidyr functions
Verification
Scope
across() edge cases, group helpers, superseded functions, pivot options and specifications, rectangling, and other dplyr 1.1 and tidyr 1.3 functions. Results compared with R's.
References
- Reference
- R 4.6.1 with dplyr 1.2.1, tidyr 1.3.2
- Versions
- R 4.6.1, dplyr 1.2.1, tidyr 1.3.2, PHP 8.5.10, phibble v0.8.0 (9e63ca5)
Data
Method
Reference results computed in R by tests/r/coverage.R and stored in tests/Fixtures/. The same operations run in phplyr in tests/CoverageTest.php, which compare every value. Values compared is the number of assertions in a case; a case fails if any assertion fails.
- Check
- Comparison with a reference implementation
- Recorded
- 2026-11-02, PHP 8.5.10, macOS (arm64), commit 65e6a46
Tolerances
|x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1)
Applies to: Floating-point values
exact equality
Applies to: Column names, row counts and order, strings, integers, booleans, dates, and missing values
x: package value; r: reference value. Absolute error: |x − r|. Relative error: |x − r| / max(|r|, 1). Max errors are over the values a row compares.
Results
26 comparisons: 26 pass, 0 fail, 0 skipped.
| Case | Quantity | Criterion | Values | Max abs. error | Max rel. error | Status |
|---|---|---|---|---|---|---|
| Names several functions with {.fn} and {.col}, and resolves helpers called on the values | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 7 | 2.7e-15 | 5.4e-16 | pass |
| Gives cur_column() inside across() | Values | exact equality | 30 | pass | ||
| Filters and mutates with if_any() and if_all(), with R NA logic | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 81 | 0 | 0 | pass |
| Treats an empty selection as FALSE for if_any() and TRUE for if_all() | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 40 | 0 | 0 | pass |
| Lists group rows and group data | Values | exact equality | 3 | pass | ||
| Gives each row its group key with cur_group() | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 49 | 0 | 0 | pass |
| Sums across columns in a rowwise table with c_across() | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 49 | 0 | 0 | pass |
| Nests groups with group_nest() and nest_by() | Values | exact equality | 12 | pass | ||
| Runs a function under other groups with with_groups() | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 26 | 2.7e-15 | 6.1e-16 | pass |
| Keeps the top rows in table order with top_n() and top_frac() | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 45 | 0 | 0 | pass |
| Recodes values by name | Values | exact equality | 3 | pass | ||
| Evaluates a window function in another order with order_by() | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 82 | 0 | 0 | pass |
| Adds rows with add_row() | Values | exact equality | 24 | pass | ||
| Nests matching rows with nest_join() | Values | exact equality | 19 | pass | ||
| Transforms names and values, and varies columns slowest | Values | exact equality | 78 | pass | ||
| Varies names slowest, summarises unused columns, and expands names and ids | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 72 | 0 | 0 | pass |
| Builds specs and pivots with them | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 61 | 0 | 0 | pass |
| Gathers and spreads | Table values | |x − r| ≤ 1e-9 + 1e-9 × max(|r|, 1) | 103 | 0 | 0 | pass |
| Widens named and unnamed elements | Values | exact equality | 34 | pass | ||
| Lengthens elements with indices | Values | exact equality | 43 | pass | ||
| Hoists components by name, position, and path | Values | exact equality | 14 | pass | ||
| Chops and unchops | Values | exact equality | 27 | pass | ||
| Packs and unpacks | Values | exact equality | 16 | pass | ||
| Extracts regex groups | Values | exact equality | 19 | pass | ||
| Separates rows on a regex | Values | exact equality | 13 | pass | ||
| Fills a sequence with full_seq() | Values | exact equality | 3 | pass |
Reproduction
Rscript tests/r/coverage.R
bin/site-verifications
- Raw record
- site/verifications/additions.json
- Input data
- tests/Fixtures