Title: | Unify Dimensionality Reduction Results |
Version: | 0.0.6 |
Description: | Dimensionality reduction (DR) is widely used in many domain for analyzing and visualizing high-dimensional data. 'tidydr' provides uniform output and is compatible with multiple methods, including 'prcomp', 'mds', 'Rtsne'. etc. |
Imports: | cluster, ggfun, ggplot2, grid, rlang, stats, utils |
Suggests: | knitr, rmarkdown, prettydoc, SingleCellExperiment, SummarizedExperiment |
VignetteBuilder: | knitr |
ByteCompile: | true |
License: | Artistic-2.0 |
URL: | https://github.com/YuLab-SMU/tidydr/ |
BugReports: | https://github.com/YuLab-SMU/tidydr/issues |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-07-25 10:31:21 UTC; HUAWEI |
Author: | Guangchuang Yu |
Maintainer: | Guangchuang Yu <guangchuangyu@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-07-25 10:50:02 UTC |
tidydr: Unify Dimensionality Reduction Results
Description
Dimensionality reduction (DR) is widely used in many domain for analyzing and visualizing high-dimensional data. 'tidydr' provides uniform output and is compatible with multiple methods, including 'prcomp', 'mds', 'Rtsne'. etc.
Author(s)
Maintainer: Guangchuang Yu guangchuangyu@gmail.com (ORCID) [copyright holder]
Authors:
Shuangbin Xu xshuangbin@163.com (ORCID)
Other contributors:
Erqiang Hu 13766876214@163.com [contributor]
See Also
Useful links:
List dimensionality reduction methods currently available
Description
This function shows available methods that worked for dr()
function.
Usage
available_methods(method = "all")
Arguments
method |
one of 'data', 'distance' or 'all' (default) |
Value
A character vector of available DR methods
Author(s)
Lang Zhou and Guangchuang Yu
Examples
available_methods()
dr
Description
dimensional reduction
Usage
dr(data, fun, ...)
Arguments
data |
input data |
fun |
function to perform dimensional reduction |
... |
additional parameters passed to 'fun' |
Details
This function call the user-provided function ('fun') to perform dimensional reduction on the input data ('data')
Value
a DrResult object, which contains 'data' (original data), 'drdata' (coordination after dimensionality reduction), eigenvalue (standard deviation explained by each dimension) and stress (evaluate the effect of dimensionality reduction)
Author(s)
Guangchuang Yu
Examples
x = dr(iris[,1:4], prcomp)
autoplot(x, aes(color=.group), metadata=iris$Species)
dr_extract
Description
dr_extract generic
Usage
dr_extract(result)
Arguments
result |
DrResult object |
Value
a list that contains components to construct a 'DrResult' object.
Author(s)
Guangchuang Yu
element_line2
Description
element_line2 for drawing shorten axis lines
Usage
element_line2(
colour = NULL,
size = NULL,
linetype = NULL,
lineend = NULL,
color = NULL,
arrow = NULL,
inherit.blank = FALSE,
id,
xlength = 0.3,
ylength = 0.3,
...
)
Arguments
colour |
line colour |
size |
line size in pts |
linetype |
line type |
lineend |
line end style (round, butt, square) |
color |
aliase to colour |
arrow |
arrow specification, as created by 'grid::arrow()' |
inherit.blank |
whether inherit 'element_blank' |
id |
1 or 2, 1 for axis.line.x.bottom and 2 for axis.line.y.left, only these two axes supported |
xlength |
length of x axis |
ylength |
length of y axis |
... |
additional parameters |
Value
element_line2 object, which is a tailored element_line object
Author(s)
Guangchuang Yu
nk
Description
Choose best K (number of clusters)
Usage
nk(data, k)
Arguments
data |
input data (a matrix or data frame) |
k |
a vector of candidate number of clusters |
Details
This function calculate the silhouette scores of each K (number of clusters).
The output object can be used to choose the best K (via summary()
or autoplot()
methods)
Value
a silinfo
object, which contains 'data' (original data), 'silinfo' (silhouette scores), and k (the input k vector)
Author(s)
Guangchuang Yu
Examples
x <- nk(iris[,-5], 2:8)
summary(x)
# to visualize the average silhouete score (y axis) with k (x axis)
autoplot(x)
# to visualize a PCA plot color by the choosing k
autoplot(x, k=3)
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
theme_dr
Description
Dimensional reduction scatter plot axis theme
Usage
theme_dr(
xlength = 0.3,
ylength = 0.3,
arrow = grid::arrow(length = unit(0.15, "inches"), type = "closed")
)
Arguments
xlength |
length of x axis |
ylength |
length of y axis |
arrow |
arrow specification, as created by 'grid::arrow()' |
Value
a theme object with shorten axes
Author(s)
Guangchuang Yu
theme_noaxis
Description
theme that remove axis
Usage
theme_noaxis(...)
Arguments
... |
additional theme setting |
Value
a theme object that disable axes
Author(s)
Guangchuang Yu