Skip to content

Tidy rewrite#11

Merged
bnaras merged 8 commits intomasterfrom
tidy-rewrite
Apr 8, 2026
Merged

Tidy rewrite#11
bnaras merged 8 commits intomasterfrom
tidy-rewrite

Conversation

@bnaras
Copy link
Copy Markdown
Owner

@bnaras bnaras commented Apr 8, 2026

Fix issues and citation

bnaras added 8 commits April 7, 2026 17:48
Issue #2: Grouped jackknife Imat construction was using
sapply(seq_len_m, sample.int, ...) which passed iteration values
as the first positional arg of sample.int, overriding the keyword
n= and enabling replacement. Fix: matrix(sample.int(n, n-r), nrow=m)
restores the correct without-replacement partition. Regenerated
bcajack fixture since old fixture captured buggy acceleration values.

Issue #7: Matrix subsetting x[-i, ] on single-column matrices drops
the dimension, returning a vector instead of a matrix. This causes
type inconsistency between jackknife (vector) and bootstrap (matrix)
calls to func. Fix: drop=FALSE on all 5 matrix subsetting sites
that pass data to func (jackknife_accel, bootstrap_resample, bca_nonpar).

Issue #4/#1 (+ PR #5 idea): regression_accel silently produced NAs
when ncol(Y) > length(nearby_idx), making lm() underdetermined.
Fix: explicit check with actionable error message suggesting to
increase B, increase kl_fraction, or use accel="jackknife".

PR #8 (Bettina Gruen): Missing return() in K=0 path was already
fixed in the tidy rewrite — bca_nonpar/bca_par use explicit
return(new_bcaboot(...)).
Replace stop/warning/cat with cli::cli_abort/cli_warn/cli_text/cli_h3
across all R files for consistent, formatted output:
- Error messages with bullet points and styled arg/code/pkg references
- Print method with cli headers and styled labels
- Warnings with cli formatting
- Add cli to Imports in DESCRIPTION
- Re-export tidy/glance generics so library(bcaboot) makes them available
- Register autoplot as S3method(ggplot2::autoplot, bcaboot)
- Import rlang::.data for ggplot2 aes() usage
- Add rlang to Imports
- Separate re-export roxygen block from _PACKAGE to fix Rd WARNING
- Add pkgdown/, README_files/ to .Rbuildignore
- Centralize all @importFrom in R/bcaboot.R
- Remove stale bcanon.Rd (function was removed)

R CMD check: 0 errors, 0 warnings, 1 NOTE (CRAN incoming only)
@bnaras bnaras merged commit 54323ab into master Apr 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant