Unify Dimensionality Reduction Results
Overview
Dimensionality reduction is widely used in many domains for analyzing and visualizing high-dimensional data. 'tidydr' provides uniform output and is compatible with multiple methods, including 'prcomp', 'cmdscale', 'Rtsne', 'umap' and 'metaMDS'. Any function returning a numeric matrix can also be used. The unified result can be visualized directly with 'ggplot2', and several methods can be run and compared in a single call.
nk()can now use any clustering method throughfun(2026-10-08, Thu)fundefaults tocluster::pam, so the default result is bit-for-bit unchangedstats::kmeansworks out of the box;stats::hclustis cut withcutree()- a function returning a plain vector of cluster labels is also accepted
- for non-
pamclusterers the silhouette width is computed withcluster::silhouette()and assembled into the same shapepam()produces silinfo_widths()exports the fine-grained silhouette widths of onek(2026-10-08, Thu)- returns a data.frame with
sample,cluster,neighborandsil_width - the per-cluster averages are attached as the
"clus.avg.widths"attribute autoplot()for asilinfoobject gained a silhouette bar plot (2026-10-08, Thu)type = "silhouette"draws the classic per-cluster bar plottypeis inferred fromkwhen it is not given, soautoplot(x)is unchanged andautoplot(x, k = 3)still draws the same plot — except that the sample labels are now correct (see the fix below)
Show all changes in 0.0.7Hide the rest of the changes in 0.0.7
- fixed:
autoplot(x, k = )alignedpam()'s silhouette table to the samples by position, butpam()returns that table sorted by cluster; the labels are now matched by sample name (agreement with the true clustering on iris, k = 3, goes from 84% to 100%) - added
dr_compare()to run several dimensionality reduction methods at once (2026-10-08, Thu) - every method is evaluated independently: a method that fails is reported in
$summarywith its error message instead of aborting the whole call $summarygivesmethod,status,n,k,has_eigenvalue,has_stressanderror, so it is visible which methods ran and which did notautoplot()facets the methods that produced plottable coordinatesDrResultgained asample_infoslot for method-specific, per-sample information (2026-10-08, Thu)- a
dr_extract()method may returnsample_info;fortify()merges its length-nelements into the returned data.frame as columns print()output is unchanged- the methods advertised by
available_methods()are now backed by tests (2026-10-08, Thu) - all 14 advertised methods are exercised end-to-end through
dr() vegan,smacof,ecodist,ade4,labdsvadded toSuggests, together withape,MASS,Rtsneanduwot, which the tests already usedavailable_methods("all")prints its closing note once instead of twice (2026-10-08, Thu)- the note is shared by the data and the distance listing but was printed from both branches, so it appeared twice; it is now printed once, after both listings
- the
"data"and"distance"branches are unchanged, and the returned value is unaffected dr()now validates itsdatainput and fails early with a tidydr-specific message instead of forwarding an obscure error from the underlying method (2026-10-08, Thu)- rejects
NULL, bare vectors (hint: useas.dist()for distance vectors), non-numeric data,data.frames with non-numeric columns, andNA/NaN/Inf distobjects remain supportednk()now validatesdataandk(2026-10-08, Thu)k = 1is rejected: the silhouette width is undefined for a single cluster (previously produced an object that could not be printed)k >= n, non-integer and non-numerickare rejected with clear messagesdatamay still be a numeric matrix, a numeric data.frame, or a 'dist' objectfortify()no longer mishandlesmetadata(2026-10-08, Thu)matrixmetadata is no longer silently dropped (converted to a data.frame)- a
listof lengthnno longer createsnjunk.group.*columns - atomic vectors (including classed ones such as
Date) are used as.group - unsupported types raise a warning listing the supported types
- added a
dr_extract()fallback for plain numeric matrices (2026-10-08, Thu) - makes
stats::cmdscale()(and any wrapped method returning a bare matrix) work - any function returning a numeric matrix with at least two columns is accepted
- non-numeric or single-column matrices are rejected
- a hand-written
dr_extract()method may return the coordinates as a numeric matrix (2026-10-08, Thu) - previously rejected with "length of 'dimnames' [2] not equal to array extent": the
Dim1,Dim2, ... names were assigned withseq_along(), which counts *elements* rather than columns on a matrix - the matrix is now converted to a data.frame, so
fortify()-- a 'ggplot2' generic -- always returns a data.frame - a
drdatathat is neither a data.frame nor a numeric matrix is now rejected with a message pointing at?dr_extract, instead of a cryptic error - added a GitHub Actions workflow that runs
R CMD checkon push and PR (2026-10-08, Thu)
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- NOTE12 OK, 1 NOTE2026-06-07
- OK14 OK2026-03-10
Documentation
- Help pages
- 11 (2 internal)includes a package overview page
- Examples that run
- 100%5 run in a plain check
- Exported functions with examples
- 50%
- Documented parameters
- 93%
- Return-value docs
- 90%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 1,493
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Issues over time
PRs over time
Commits over time
4 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/yulab-smu/tidydr on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.0.7Latest
- RR 4.6.0 released · 2026-04-24
- 0.0.6
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.0.52023-03-08 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.0.4
- 0.0.32021-12-08
- RR 4.1.0 released · 2021-05-18
Package metadata
- First published
- 2021-12-08
- Total releases
- 5 / 5 yrs
- License
- Artistic-2.0 OSI
- Download size
- 334 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("tidydr")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
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.