do.radviz | R Documentation |
do.radviz will return a projection of a multidimensional dataset onto a 2D space
defined by dimensional anchors that have been projected on the unit circle using
make.S
do.radviz( x, springs, trans = do.L, scaling = 1, label.color = "orangered4", label.size = NA, type = NULL, graph = NULL )
x |
a data.frame or matrix to be projected, with column names matching row names in springs |
springs |
a matrix of 2D dimensional anchor coordinates, as returned by |
trans |
a transformation to be applied to the data before projection |
scaling |
a scaling factor applied to data before the projection. |
label.color |
deprecated, use |
label.size |
deprecated, use |
type |
character string specifying the method used for obtaining the springs.
Current methods are: Radviz, Freeviz and Graphviz. When not provided, |
graph |
|
The function expects that at least some of the column names in x
will be matched by all row names in springs.
The scaling factor can be used to increase the distance between points,
making it useful in situations where all points are pulled together either
because of similar values or large number of channels.
The scaling is applied **after** the transformation by trans
.
The scaling idea is taken from [Artur & Minghim 2019](https://doi.org/10.1016/j.cag.2019.08.015).
an object of class radviz with the following slots:
proj
: a ggplot2 object with a single geom_text layer corresponding to springs.
the data
slot of the ggplot2 corresponds to the input parameter x
with the following extra columns:
rx
and ry
the X and Y coordinates of the radviz projection of x
over springs
rvalid
an index of points corresponding to an invalid projection (any rx
or ry
is NA)
springs
: the matrix containing the spring coordinates.
type
: character string specifying the method used for obtaining the springs.
trans
: the function used to transform the data.
graphEdges
: when the input graph
is provided (for a Graphviz analysis),
this slot will contain a dataframe with the graph edges
Yann Abraham
data(iris) das <- c('Sepal.Length','Sepal.Width','Petal.Length','Petal.Width') S <- make.S(das) rv <- do.radviz(iris,S) summary(rv) data(iris) das <- c('Sepal.Length','Sepal.Width','Petal.Length','Petal.Width') iris0 <- rbind(iris,c(rep(0,length(das)),NA)) S <- make.S(das) rv0 <- do.radviz(iris0,S) sum(!is.valid(rv0)) # should be 1 # to find which points where invalid in the data which(!is.valid(rv0)) # to review the original data points rv1 <- subset(rv0,is.valid(rv0)) summary(rv1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.