R: Plot maps of the factor scores and partial factor scores of...
GraphDistatisPartial
R Documentation
Plot maps of the factor scores and partial factor scores of the observations for a DISTATIS analysis.
Description
GraphDistatisPartial plots maps of the factor scores of the observations
from a distatis analysis. GraphDistatisPartial gives a map of the factors scores of the observations plus partial factor scores, as "seen" by each of the matrices.
The factor scores of the observations ($res4Splus$Ffrom distatis).
PartialFS
The partial factor scores of the observations ($res4Splus$PartialF from distatis)
axis1
The dimension for the horizontal axis of the plots.
axis2
The dimension for the vertical axis of the plots.
constraints
constraints for the axes
item.colors
A I*1 matrix (with I = # observations)
of color names for the observations. If NULL (default), prettyGraphs chooses.
participant.colors
A I*1 matrix (with I = # participants)
of color names for the observations. If NULL (default), prettyGraphs chooses.
ZeTitle
General title for the plots.
Ctr
Contributions of each observation. If NULL (default), these are computed from FS
color.by.observations
if TRUE (default), the partial factor scores are colored by item.colors. When FALSE, participant.colors are used.
nude
When nude is TRUE the labels for the observations are not plotted (useful when editing the graphs for publication).
lines
If TRUE (default) then lines are drawn between the partial factor score of an observation and the compromise factor score of the observation.
Details
Note that, in the current version, the graphs are plotted as R-plots
and are not passed back by the routine.
So the graphs need to be saved "by hand" from the R graphic windows.
We plan to improve this in a future version.
Value
constraints
A set of plot constraints that are returned.
item.colors
A set of colors for the observations are returned.
participant.colors
A set of colors for the participants are returned.
Author(s)
Derek Beaton and Herve Abdi
References
The plots are similar to the graphs from
Abdi, H., Valentin, D., O'Toole, A.J., & Edelman, B. (2005).
DISTATIS: The analysis of multiple distance matrices.
Proceedings of the IEEE Computer Society: International Conference on Computer Vision and Pattern Recognition.
(San Diego, CA, USA). pp. 42-47.
# 1. Load the DistAlgo data set (available from the DistatisR package)
data(DistAlgo)
# DistAlgo is a 6*6*4 Array (face*face*Algorithm)
#-----------------------------------------------------------------------------
# 2. Call the DISTATIS routine with the array of distance (DistAlgo) as parameter
DistatisAlgo <- distatis(DistAlgo)
# 3. Plot the compromise map with the labels for the first 2 dimensions
# DistatisAlgo$res4Splus$F are the factors scores for the 6 observations (i.e., faces)
# DistatisAlgo$res4Splus$PartialF are the partial factors scores
##(i.e., one set of factor scores per algorithm)
GraphDistatisPartial(DistatisAlgo$res4Splus$F,DistatisAlgo$res4Splus$PartialF)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DistatisR)
Loading required package: prettyGraphs
Loading required package: car
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DistatisR/GraphDistatisPartial.Rd_%03d_medium.png", width=480, height=480)
> ### Name: GraphDistatisPartial
> ### Title: Plot maps of the factor scores and partial factor scores of the
> ### observations for a DISTATIS analysis.
> ### Aliases: GraphDistatisPartial
> ### Keywords: DistatisR mds
>
> ### ** Examples
>
> # 1. Load the DistAlgo data set (available from the DistatisR package)
> data(DistAlgo)
> # DistAlgo is a 6*6*4 Array (face*face*Algorithm)
> #-----------------------------------------------------------------------------
> # 2. Call the DISTATIS routine with the array of distance (DistAlgo) as parameter
> DistatisAlgo <- distatis(DistAlgo)
> # 3. Plot the compromise map with the labels for the first 2 dimensions
> # DistatisAlgo$res4Splus$F are the factors scores for the 6 observations (i.e., faces)
> # DistatisAlgo$res4Splus$PartialF are the partial factors scores
> ##(i.e., one set of factor scores per algorithm)
> GraphDistatisPartial(DistatisAlgo$res4Splus$F,DistatisAlgo$res4Splus$PartialF)
dev.new(): using pdf(file="Rplots139.pdf")
$constraints
$constraints$minx
[1] -0.909196
$constraints$maxx
[1] 0.909196
$constraints$miny
[1] -0.909196
$constraints$maxy
[1] 0.909196
$item.colors
[,1]
[1,] "#305ABF"
[2,] "#84BF30"
[3,] "#BF30AD"
[4,] "#30BFA7"
[5,] "#BF7D30"
[6,] "#5430BF"
$participant.colors
[,1]
[1,] "#305ABF"
[2,] "#84BF30"
[3,] "#BF30AD"
[4,] "#30BFA7"
>
>
>
>
>
> dev.off()
png
2
>