| dr | R Documentation |
dimensional reduction
dr(data, fun, ...)
data |
input data |
fun |
function to perform dimensional reduction |
... |
additional parameters passed to 'fun' |
This function call the user-provided function ('fun') to perform dimensional reduction on the input data ('data')
sample_info is an optional list that a dr_extract() method may return
alongside the coordinates. It is meant to carry method-specific, per-sample
information (e.g. local density, k-nearest-neighbour indices or cluster
labels). Every element of sample_info that holds one value per sample – a
vector or factor of length nrow(data) – is merged into the data.frame
returned by fortify(), using the element name as the column name, so that
it can be mapped in autoplot(). Elements that do not hold one value per
sample, and elements whose name is already taken by a coordinate or a
metadata column, are not merged and a warning is issued. None of the
dr_extract() methods shipped with the package returns a sample_info
element, so sample_info is NULL unless a custom dr_extract() method
supplies one.
a DrResult object, which contains 'data' (original data), 'drdata' (coordination after dimensionality reduction), eigenvalue (standard deviation explained by each dimension), stress (evaluate the effect of dimensionality reduction) and 'sample_info' (method-specific additional information, see Details)
Guangchuang Yu
x = dr(iris[,1:4], prcomp)
autoplot(x, aes(color=.group), metadata=iris$Species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.