distGPS
object. Metric
and non-metric algorithms are available, as well as an optimization
algorithm for improving r-square correlation between observed and
approximated distances. The MDS calculation for a given distance
matrix can be splitted into smaller individual tasks and run in
parallel, greatly improving CPU time and system memory usage. The S4
accessor functions getR2, getStress, getPoints
retrieve R-square correlation, stress and points stored within a
mds
object respectively. The function is.adj
is useful
to know if a certain chroGPS MDS map has been adjusted by Procrustes
or not (see help for procrustesAdj
for details.)
mds(d, m = NULL, k = 2, type = "classic", add = FALSE, cor.method = "pearson", splitMDS = FALSE, split = 0.26, overlap = 0.025, stepSize=0.01, reshuffle = TRUE, set.seed = 149, mc.cores = 1, ...)
getR2(m)
getStress(m)
getPoints(m)
distGPS
with the pairwise observed dissimilarities
between elements, a distance matrix.
mds
with a MDS object generated from the
distances in d
. Only MDS type "boostMDS" is available. The mds
function performs an optimization of the approximated distances in
m
in order to improve r-square correlation between them and the
observed dissimilarities en d
, maximizing goodness of fit.
"classic"
to perform classical MDS (uses
function cmdscale
from package stats
). Set to
"isoMDS"
to use Kruskal's non-metric MDS (uses function
isoMDS
from package MASS
) Set to "boostMDS" to perform
r-square optimization of a pre-computed input MDS for that distance
matrix.
cmdscale
.
TRUE
to perform computation of the MDS in parallel
(see parameters below).
boostMDS
is called, see specific help function for details.
mclapply
function from
the parallel
package, used to perform the parallel MDS computations.
cmdscale
, isoMDS
or
boostMDS
, see each individual help file for details.
mds
object. See help ("mds-Class") for details.
signature(d = "distGPS", m = "missing")
: Creates a
mds
object with points in a k-dimensional space approximating
the pairwise distances in d
. signature(d = "distGPS", m = "mds")
: For the
observed dissimilarities in d
and a valid spatial
representation of them in m
, the function returns a
mds
object with an optimized representation of d
in
terms of R-square. The MDS stress measure is also
returned. See help for boostMDS
for details.signature(m = "mds")
: S4 plot method for
mds
objects. MASS
.
x <- rbind(c(rep(0,15),rep(1,5)),c(rep(0,15),rep(1,5)),c(rep(0,19),1),c(rep(1,5),rep(0,15)))
rownames(x) <- letters[1:4]
d <- distGPS(x,metric='tanimoto',uniqueRows=TRUE)
mds1 <- mds(d)
mds1
plot(mds1)
#gps2xgmml(mds1, fname='chroGPS_factors.xgmml', fontSize=4,col=col2hex('red'), cex=8)
Run the code above in your browser using DataLab