Biplot Analysis for Multivariate Data Using Principal Components
Overview
Provides tools for creating 2D and 3D biplots of multivariate data based on principal components analysis, together with diagnostics for reduction quality and enhanced visualization of variables and objects.
Breaking changes
var.rdf()now returns a structured list of class'var.rdf'instead of a plain characterdata.frame. The three fields are:$display(characterdata.framewith'*','', and'-'entries, for tabular display),$numeric(numeric matrix of absolute percentage differences), and$flagged(logical matrix,TRUEwhere the discrepancy exceedslimit). Code that accessedbp$var.rdas adata.framedirectly must be updated to usebp$var.rd$display.summary.bpca()no longer accepts thepresentationargument. The printing behaviour previously triggered bypresentation = TRUEis now handled by the newprint.summary.bpca()S3 method; callingprint(summary(bp))produces the same output.
New S3 methods
print.var.rdf(): printing avar.rdfobject (e.g.print(bp$var.rd)) automatically displays the character table ($display).print.summary.bpca(): separates computation from presentation following R's S3 convention.summary.bpca()now only computes and returns the summary object;print.summary.bpca()handles console output.
Internal refactoring (no public API change)
- New file
R/bpca-utils.Rintroduces four shared internal helpers that eliminate duplicated code across the package: .center_scale(x, center, scale): centering and scaling logic previously duplicated betweenbpca.default()anddt.tools()..cosine_matrix(m): pairwise cosine similarity between rows of a matrix, previously duplicated betweenvar.rbf()anddt.tools()..compute_var_factor(coobj, covar): automatic variable-scaling factor for biplots, previously duplicated betweenplot.bpca.2d()andplot.bpca.3d()..pc_axis_labels(eigenvalues, dims): axis labels in"PC1 (38.5%)"format, previously duplicated betweenplot.bpca.2d()andplot.bpca.3d().
Show all changes in 1.5-0Hide the rest of the changes in 1.5-0
plot.bpca.2d()decomposed from a single 634-line function into three files:R/plot.bpca.2d.helpers.R: eight internal drawing functions (.draw_obj(),.draw_var(),.draw_var_seg(),.draw_circles(),.draw_axis_cross(),.proj_on_direction(),.solve_orthogonal_intersection(),.draw_circles_at()), extracted from closures that were recreated on every call.R/plot.bpca.2d.types.R: ten internal type functions (.plot_type_bp()through.plot_type_rv()), one perswitchbranch, each independently readable and testable.R/plot.bpca.2d.R: reduced to ~160 lines — validation, state preparation, context list (ctx) construction, and dispatch viaswitch().pc.namesinbpca.default()is now generated once and reused forsvdx.scal$v,g.scal, andhl.scalcolumn names (previously generated twice).- The fragile
whileloop inplot.bpca.2d(type = 'ww')— which relied on anNAsentinel at the end ofchull()output — was replaced by aforloop with circular indexing over all convex-hull edges, including the closing edge.
Testing
- Test suite expanded from 3 to 45 tests. New coverage includes: all four factorization methods (
hj,sqrt,jk,gh); all four centering modes (center = 0:3); all four internal helpers (.center_scale,.cosine_matrix,.compute_var_factor,.pc_axis_labels);var.rbfandvar.rdf(including the new list structure);dt.tools;qbpca;summary.bpcaandprint.summary.bpca; all ten 2D plot types; 3D static plot;plot.qbpca; andbpca.prcomp.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 14includes a package overview page
- Examples that run
- 100%14 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 57%
Also includes 12 demo scripts (run with demo())
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
PRs over time
Commits over time
Commit identities over time
Checks run against github.com/jcfaria/bpca on 2026-10-11.
No development-tooling practices detected in the upstream repository.
This repository shows signs of AI coding tools.
- Cursorfirst seen 2026-04-30Pull request it wrote: opened by a project memberCommits: 2 by its own account · at least 21 crediting it in the message
- Claude Codefirst seen 2026-10-06Commits: at least 1 crediting it in the message
- Claude Opus 5.51 commit · Oct 2026
Dependencies
Code & Tests
Datasets
People & History
Maintainer since 1.0.2 (2008)
Pick two releases to compare their code metrics.
- 1.5-0Latest
- 1.4-32026-05-11 · diff ↗ ·
removed 1 export
pattern:.added 6 exports
bpca, dt.tools, qbpca, var.rbf, var.rdf, xtable.bpca - RR 4.6.0 released · 2026-04-24
- 1.3-92026-04-21 · diff ↗
- 1.3-82025-09-11 · diff ↗
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- unarchivedReturned to CRAN2023-11-20
- 1.3-62023-11-20 · diff ↗
- archivedRemoved from CRAN2023-09-13issues were not corrected despite reminders
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 1.3-42021-03-22 · diff ↗
- 1.3-22020-05-10 · diff ↗
- RR 4.0.0 released · 2020-04-24
Show 24 earlier eventsHide 24 earlier events
- RR 3.6.0 released · 2019-04-26
- 1.3-02018-06-12 · diff ↗
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- 1.2-22013-11-24 · diff ↗
- RR 3.0.0 released · 2013-04-03
- RR 2.15.0 released · 2012-03-30
- 1.0-10
- RR 2.14.0 released · 2011-10-31
- 1.0-82011-04-24 · diff ↗
- RR 2.13.0 released · 2011-04-13
- 1.0-52011-04-10 · diff ↗
- 1.0-42011-03-24 · diff ↗
- RR 2.12.0 released · 2010-10-15
- RR 2.11.0 released · 2010-04-22
- RR 2.10.0 released · 2009-10-26
- 1.0.32009-06-22 · diff ↗
- RR 2.9.0 released · 2009-04-17
- RR 2.8.0 released · 2008-10-20
- 1.0.22008-08-17
- RR 2.7.0 released · 2008-04-22
Package metadata
- First published
- 2008-08-17
- Total releases
- 15 / 18 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 1.6 KB / 4 files
- Download size
- 263 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("bpca")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.