shiftvector: Compute a shift vector for a calibrated axis.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/shiftvector.R

Description

shiftvector computes two shift vectors perpendicular to the supplied biplot or scatterplot axis g. The vector norm is computed from the two most extreme data points.

Usage

1
shiftvector(g, X, x = c(1, 0), verbose = FALSE)

Arguments

g

a biplot or scatterplot axis

X

a n by 2 matrix of scatterplot or biplot coordinates

x

reference axis, (1,0) by default

verbose

print information or not

Details

shiftvector locates the tow most extreme datapoints in the direction perpendicular to axis g.

Value

dr

the right (w.r.t. the direction of g) shift vector

dl

the left (w.r.t. the direction of g) shift vector

Author(s)

Jan Graffelman (jan.graffelman@upc.edu)

References

Graffelman, J. and van Eeuwijk, F.A. (2005) Calibration of multivariate scatter plots for exploratory analysis of relations within and between sets of variables in genomic research Biometrical Journal, 47(6) pp. 863-879.

Graffelman, J. (2006) A guide to biplot calibration.

See Also

calibrate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
X <- matrix(rnorm(100),ncol=2)
Xs <- scale(X)

g <- c(1,1)

plot(Xs[,1],Xs[,2],asp=1,pch=19)
textxy(Xs[,1],Xs[,2],1:nrow(X))

arrows(0,0,g[1],g[2])
text(g[1],g[2],"g",pos=1)

out <- shiftvector(g,X,verbose=TRUE)
dr <- out$dr
dl <- out$dl

arrows(0,0,dl[1],dl[2])
text(dl[1],dl[2],"dl",pos=1)

arrows(0,0,dr[1],dr[2])
text(dr[1],dr[2],"dr",pos=1)

calibrate documentation built on July 1, 2020, 7:03 p.m.