Skip to content

Tidy rewrite#10

Closed
bnaras wants to merge 5 commits intomasterfrom
tidy-rewrite
Closed

Tidy rewrite#10
bnaras wants to merge 5 commits intomasterfrom
tidy-rewrite

Conversation

@bnaras
Copy link
Copy Markdown
Owner

@bnaras bnaras commented Apr 8, 2026

Fixed up issues

bnaras added 5 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
@bnaras bnaras closed this Apr 8, 2026
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