Skip to content

Merge my fork? - #76

Open
friendly wants to merge 111 commits into
vqv:masterfrom
friendly:master
Open

Merge my fork?#76
friendly wants to merge 111 commits into
vqv:masterfrom
friendly:master

Conversation

@friendly

Copy link
Copy Markdown
Collaborator

OK, here's all the work I've done since I started on this.

If you prefer, you could merge this into a new branch friendly, but that might be more work.

You can comment on this PR before you accept it & merge

friendly and others added 30 commits September 16, 2025 10:56
The old man/figures/logo.png had a solid white background that looked
bad in dark mode. Replaced with a transparent-background PNG at the
same resolution.
Picks up the transparent hex logo, plus a newer-pkgdown template refresh
(Bootstrap 5.3.8, font-awesome/jquery/headroom/search dep bumps,
llms.txt/*.md mirrors) since the installed pkgdown is newer than whatever
last built this site. Reference example plots also re-rendered.
Move examples/ggvector.R to R/ggvector.R, rewrite it around
ggarrow::geom_arrow_segment(), and export it as a user-facing helper for
drawing labeled vectors from a common origin (e.g. supplementary
variables added to an existing biplot). Fixes two latent bugs in the
old prototype: the scale argument was declared but never applied, and
label angle/hjust ignored a non-default origin.

ggbiplot() now calls ggvector() at both of its variable-vector call
sites (arrows before the ellipse layer, labels after, preserving the
original z-order) instead of the inline geom_segment()+grid::arrow()
code. ggarrow is now a hard dependency (Imports), since it's the
default renderer, not an opt-in extra.

Verified with devtools::check() (0 errors/warnings/notes) under both
ggarrow 0.1.1 (CRAN) and 0.2.0.9000 (GitHub dev) -- the
geom_arrow_segment()/arrow_head_wings() API used here is unchanged
between them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GUuPdPVD5x2719qyDNxdY8
varname.gap renames ggvector()'s resect arg to gap and wires it up as a
ggbiplot()-level argument, pulling variable-vector arrowheads back (in mm)
from their true endpoint to clear the correlation circle or crowded labels.

vector.args is a generic named-list passthrough to the arrow-drawing
ggvector() call, addressing the observation that ggarrow's default
arrowhead ornament renders noticeably heavier than the old grid::arrow()
one (e.g. vector.args = list(linewidth = 0.5)); anything not matched by a
ggvector() argument flows on to ggarrow::geom_arrow_segment() (justify,
force_arrow, sep, distort, ...).

Adds a top-level issues/ dir (Rbuildignore'd) for this kind of notes/test
script going forward.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpEQGVbJfVdBnssW7J5QvL
ggarrow's default arrow_head_wings() ornament reads visually heavier than
the old grid::arrow()-based triangular arrowhead at the same linewidth, so
the previous default of 1.4 (matched to the old shaft width) looked
noticeably thicker. Comparing panels on both wine and crime data settled
on keeping arrow_head_wings() (preferred over arrow_head_line()) with the
shaft linewidth lowered to 0.9. vector.args = list(linewidth = 1.4)
restores the old weight.

issues/arrow-tests.R rebuilds the old vs. new arrow comparison on the
crime dataset (pulling the pre-ggarrow ggbiplot() from git history),
matching what README.Rmd's crime-biplot1 example actually shows rather
than wine. Also flags (not fixed here) two unrelated bugs found while
building it: README.Rmd's ellipse.level should be ellipse.prob, and its
crime-biplot1 chunk needs geom.ind = "text" to keep showing state labels
under the current geom.ind default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpEQGVbJfVdBnssW7J5QvL
crime-biplot1 passed ellipse.level (not a ggbiplot() argument; silently
absorbed by ...) instead of ellipse.prob. Both crime chunks relied on
labels = crime$st to show state abbreviations, but geom.ind defaults to
"point" (since v0.6.4) and no longer auto-switches to text, so replaying
them showed plain colored points with no labels. Added geom.ind = "text"
to both.

Re-knit via devtools::build_readme() (installs the current dev version
first so packageVersion() picks up 0.6.5 instead of the stale 0.6.2 in
the system library) — also refreshes the reference figures with the new
linewidth = 0.9 default arrows.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpEQGVbJfVdBnssW7J5QvL
- Bump stale Date field, clearing the "Date field is over a month old"
  R CMD check NOTE.
- Rewrite cran-comments.md for this submission (was still describing
  the earlier 0.6.2 release).
- Convert the varname.gap/vector.args roxygen blocks in ggbiplot.R from
  Rd macros to markdown syntax, matching the rest of the package's
  documentation style.
- Fix millimetres -> millimeters (Language: en-US) in ggbiplot.R and
  ggvector.R docs.
- Add newly-introduced technical terms to inst/WORDLIST so spell_check()
  stays clean.

devtools::check(cran = TRUE, remote = TRUE): 0 errors, 0 warnings, 0 notes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCpb3UU6Rebmr2saN5Lkn6
- Add ggvector() to the reference index (was exported but missing,
  which broke pkgdown::build_site() outright).
- Fix _pkgdown.yaml's site url to https, matching DESCRIPTION's URL
  field (was flagged by pkgdown's sitrep as a URL mismatch).
- Rebuilt site picks up the 0.6.2 -> 0.6.5 version bump on the home
  page badge, previously stale.
- Add "pre" to inst/WORDLIST (spelling::spell_check_package() now
  reports no errors).
- Ignore the release-check helper's .release_check_result.rds
  artifact (myutil::release_check()) in .gitignore/.Rbuildignore.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCpb3UU6Rebmr2saN5Lkn6
Matches the convention used in Michael's other packages (heplots,
Guerry, etc.).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCpb3UU6Rebmr2saN5Lkn6
release_revdep() left an ~11MB revdep/checks + revdep/library +
data.sqlite behind. Add revdep/.gitignore (standard revdepcheck
pattern) and ^revdep$ to .Rbuildignore so only the small summary
files (README.md, cran.md, problems.md, failures.md) are tracked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCpb3UU6Rebmr2saN5Lkn6
ggvector()'s text labels always angled along each vector's own
direction, with no way to override it -- forcing a workaround of
drawing labels separately with a plain geom_text() when horizontal
(or any fixed-angle) labels were wanted (see Vis-MLM-book's
diabetes-mds.R). angle = NULL keeps the existing per-vector behavior;
a fixed number draws every label at that angle instead. Exposed on
ggbiplot() as varname.angle, threaded to the text-layer call only
(matches how varname.gap threads to the arrow-layer call).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TCpb3UU6Rebmr2saN5Lkn6
ggplot2 computes axis limits from each layer's anchor coordinates
only, not the rendered text's extent, so a long variable name (or one
pushed outward by a large varname.adjust) can extend past the panel
edge and get silently truncated under the old clip = "on" default.
"off" lets that overflow draw into the margin instead. Pass
clip = "on" to restore the old behavior.
…abeling

Finishes the ggplot2-layer mechanism sketched but never completed in
heplots/dev/stat_noteworthy.R, wrapping the already-shipped
heplots::noteworthy() for point selection. Verified the draft's
documented "DOESN'T WORK" bug (stat_noteworthy(method=, label=)) does
not actually reproduce under current ggplot2 -- see dev/test-noteworthy.R
for the non-confounded repro and 14 worked examples (every noteworthy()
method, level filtering, multiple geoms, composition on top of a real
ggbiplot()).

dev/stat_noteworthy.R: the StatNoteworthy ggproto + stat_noteworthy()
constructor, with a production-style roxygen doc block.
dev/test-noteworthy.R: bug check + examples, split out separately.

Prototype only -- no ggbiplot()/ggvector() argument added yet, no
version bump, no NEWS.md entry (dev/ is .Rbuildignore'd).
Matches the convention used for heplots/vcdExtra/etc. Moved the
completed ggarrow integration plan out to issues/task-ggarrows.md
(kept for reference, no longer an active task). TASKS-all.md's
ggbiplot section now just points here.
test-noteworthy.R: added section testing whether point selection is
correctly scoped per facet_wrap() panel (yes) vs. per aes(color=)
group sharing one panel (no, pooled globally -- known compute_panel()
vs compute_group() tradeoff). Also print each example plot.

ggextenders-noteworthy.md: notes from the original ggplot-extension-club
discussion #91 (opened by friendly) that the StatNoteworthy design was
based on -- facet/group scoping design menu, a sharper root-cause
diagnosis of the label= bug than previously documented, a real
repel/label-blanking gap for dense plots, and prior-art pointers.
…and scale arg

Existing prcomp/princomp/PCA/lda behavior is unchanged (pure refactor
of the old if/else chain into one method per class). New
reflect.data.frame()/reflect.matrix()/reflect.list() negate the given
columns (by name or index) directly, so other packages/objects can
register their own reflect.<class>() method instead of needing
changes here -- matches what candisc's own notes wanted this for.

All methods also gain a scale argument (default 1): selected columns
become -scale * columns instead of just -1 * columns, e.g. to stretch
or shrink variable vectors in a biplot at the same time as reflecting
them (a negative scale scales without reflecting).

Verified all methods + error paths manually; devtools::check() 0/0/0.
No version bump (folded into the still-unreleased 0.6.6).
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.

2 participants