replotontraj: replotontraj This function takes an object from finction...

Description Usage Arguments Author(s) Examples

Description

replotontraj This function takes an object from finction ontrajplot() and uses it in order to re-plot rapidly the results of ontrajplot().

Usage

1
2
3
4
5
replotontraj(ontrajplotobject, zlimp = NULL, zlimo = NULL, fromp = NULL,
  top = NULL, fromo = NULL, too = NULL, linksscol = 2, lwdt = 1,
  lwds = 1, scaleramp = F, heatcolors = c("blue4", "cyan2", "yellow",
  "red4"), polyn = 1, mar = c(0.3, 0.3, 0.3, 0.3), mai = c(0, 0, 0.3, 0),
  oma = c(0, 0, 3, 0), mag = 1, levelcex2d = 1)

Arguments

ontrajplotobject

list: an object outputted by ontrajplot()

zlimp

numeric: range for colors for heatmap in 2D for transported predictions.

zlimo

numeric: range for colors for heatmap in 2D for original predictions.

fromp

numric: lower limit for colors for heatmap in 2D for transported predictions.

top

numeric: higher limit for colors for heatmap in 2D for transported predictions.

fromo

numeric: lower limit for colors for heatmap in 2D for original predictions.

too

numeric: higher limit for colors for heatmap in 2D for transported predictions.

linksscol

numeric: color of links plotted on source.

lwdt

numeric: width of links for target.

lwds

numeric: width of links for source.

scaleramp

logical: "scaleramp" argument in meshDist() function in "Morpho" package

heatcolors

character: Color palette for heatmap (by default=c("blue4","cyan2","yellow","red4"))

polyn

numeric: the degree of regression. This should equal the same argument in ptau6().

mar

numeric: "mar" argument in par() (default=c(0.3,0.3,0.3,0.3))

mai

numeric: "mai" argument in par() (default=c(0,0,0.3,0))

oma

numeric: "oma" argument in par() (default=c(0,0,3,0))

mag

numeric: magnification parameter

levelcex2d

numeric: text size for group names for 2D data

Author(s)

Paolo Piras

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
## Not run:  
data(group)
data(my2d)
mysel<-group%in%c("Macroscelides_proboscideus","Petrodromus_tetradactylus","Elephantulus_rozeti","Elephantulus_edwardii")
linksdors<-list(c(1,2),c(37,7),c(12,4),c(27,28),c(25,21),c(38,40),c(9,10),c(2,3),c(3,4),c(1,7),c(1,6),c(3,5),c(6,40),c(5,9),c(40,8),c(8,9),c(1,7),c(7,6),c(3,4),c(4,5),c(39,38),c(38,35),c(35,37),c(37,39),c(35,34),c(34,33),c(33,32),c(32,31),c(31,30),c(30,29),c(29,37),c(37,36),c(36,29),c(28,31),c(28,30),c(13,10),c(10,11),c(11,12),c(12,13),c(13,14),c(14,16),c(16,17),c(17,20),c(20,19),c(19,18),c(18,12),c(18,15),c(15,12),c(21,19),c(21,20),c(24,25),c(25,26),c(26,27),c(27,24),c(26,24),c(24,23),c(23,22),c(22,8),c(8,2))       
dors4<-my2d[,,mysel]
factordors4<-drop.levels(group[mysel],reorder=T)
factordors4<-factor(factordors4,levels=unique(factordors4))
adors4<-procSym(dors4,scale=F,pcAlign=F,reflect=F)
mypredictbook<-read.inn(predict(lm(array2mat(adors4$orpdata,105,80)~poly(adors4$size,1,raw=T)*factordors4)),40,2)
procbook<-procSym(mypredictbook,pcAlign=F)
# linear shift in the shape space
plot(procbook$PCscores[,1:2],pch=as.numeric(factordors4),asp=1)
objptau2d<-ptau6(dors4,factordors4,CSinit=T,perm=2)
ontra20<-ontrajplot(objptau2d,links=linksdors,grid2d=F)#### just shapes
ontra21<-ontrajplot(objptau2d,links=linksdors,heat=F,mag=2)#### tpsgrid
replotontraj(ontra21)##replot rapidly
ontra22<-ontrajplot(objptau,links=linksdors,heat=T,mag=2)#### tpsgrid and heatmap necessarily slow
replotontraj(ontra22,zlimo=c(-3,2)) ##replot rapidly by adjusting zlim for original per group predictions 
########  3D example
data(pri3d)
data(surf)
data(linksbase)
data(linksface)
data(linksentire)
data(sur_ent)
data(sur_fac)
data(sur_bas)
data(my2d)
data=pri3d
my3d<-centershapes(data)
amy3d<-procSym(my3d)
group<-factor(substr(dimnames(amy3d$orpdata)[[3]],1,7))
objptau3<-ptau6(amy3d$orpdata,group,CSinit=T,perm=2)
## not run
ontra31<-ontrajplot(objptau3, links=NULL)#### only shapes with links
ontra32<-ontrajplot(objptau3,triang=t(sur_ent$it)) ## only meshes no heatmap
replotontraj(ontra32,zlimo=c(-3,2))##replot rapidly
ontra33<-ontrajplot(objptau3,triang=t(sur_ent$it),heat=T,mag=1)#### mesh with heatmap in 3D; necessarily slow: about 20 minutes
replotontraj(ontra33)##replot rapidly the object
replotontraj(ontra33)##replot rapidly the object

## End(Not run)

deformetrics/deformetrics documentation built on May 15, 2019, 3:20 a.m.