Hello everyone,
Just a question regarding the plotting of deformation grinds of the trajectory analysis (e.g. pupfish or plethodon data). Can shape.predictor function be used for visualizing TA$pc.means since TA$pc.data corresponds to PC scores obtained for Y.gpa$coords? Thank you for your given time and consideration. Sincerely, Igor Dana srijeda, 25. srpnja 2018. u 14:42:41 UTC+2, korisnik javiersantos3 napisao je: > > Hello Carmelo and Mike, > > > Thanks for the quick response! I see things now clearer, especially with > the examples you have both provided. Sometimes one gets disoriented in the > abstractness of shape space and coding ;-P Thanks again! > > > > Best wishes, > > Javier > > > > ------------------------------ > *From:* Mike Collyer <mlco...@gmail.com <javascript:>> > *Sent:* Wednesday, July 25, 2018 2:29:38 PM > *To:* Javier Santos > *Cc:* Morphomet Mailing List > *Subject:* Re: Conceptual clarification of plotting shape deformation > grids in geomorph > > Javier, > > First your plotting question. The plot.trajectory.analysis function is an > S3 generic plot function, which means you can modify the plot as you like. > You do this easiest with the points function. Here is an example, using > the help page example, which hopefully makes sense for you: > > data(plethodon) > Y.gpa <- gpagen(plethodon$land) > gdf <- geomorph.data.frame(Y.gpa, species = plethodon$species, site = > plethodon$site) > > TA <- trajectory.analysis(coords ~ species*site, data=gdf) > summary(TA, angle.type = "deg") > plot(TA) > > # Augment plot with the following code > > points(TA$pc.data, pch=19, col = "blue”) # turn all points blue > points(TA$pc.data, pch=19, col = TA$groups) # change points to different > colors, by group > > One can modify plots as desired but you might need to learn how to use > graphical parameters in order to do it. See the help for the function, > par, to know how to do that. > > Second, since PC scores are Procrustes residuals (coordinates) projected > onto PC axes, there is a direct correspondence between an observation’s set > of coordinates and its PC scores. If you perform trajectory analysis, the > $means object has the coordinates for the means (trajectory points). You > simply have to rearrange the values with arrayspecs to generate deformation > grids. The $pc.data is a matrix of PC scores whose rows correspond to the > coordinates in the gpagen object. For example, TA$pc.data[5,] is a set of > PC scores for Y.gpa$coords[,,5]. > > Finally, for your last question, the function shape.predictor does exactly > what you seek. The help page has examples that should help you (on e > specifically for allometry). > > Cheers! > Mike > > On Jul 25, 2018, at 7:17 AM, Javier Santos <javier...@hotmail.com > <javascript:>> wrote: > > Hello Morphometricians, > > I was hoping someone could clarify the concept of plotting shape > deformation grids from the geomorph output. I am confused at the moment > because the output of most functions (eg. trajectory.analysis()) gives PC > values or regression scores, while most of the plotting functions I know > (eg. plotRefToTarget(), plotTangentSpace(), plotAllSpecimens()) require > LM coordinates. I am sure that the conceptual framework to plot the shape > deformation grids corresponding from the PC/regression values of the > functions' output should not be too complicated, but I am currently lost > how to do so with the coding and do not have a working example. > > I will use my current analysis as an example from which to work upon. I > have ran a trajectory.analysis() on a three species sample: > > ontogeny <- trajectory.analysis(M2d ~ > species*age,f2=NULL,iter=999,seed=NULL,data=gdf) > > and plot the results: > > x11(); > plot(ontogeny,group.cols=c("red","blue","green"),pt.scale=1.5,pt.seq.pattern=c("black","gray","white")) > > The following code plots the trajectory in the corresponding PC1-PC2 > morphospace with each species' trajectory in a different color, however, > although the lines are different colors, the points corresponding to each > individual are grey for all species. How can I color these points by > species group without exporting the data? > I would also like to plot the shape deformation that corresponds to each > PC axis like the function plotTangentSpace() does. How can that be coded > from the output of the trajectory.analysis()? > And lastly, how do you code, for example, when the shape deformation you > want to plot corresponds to the $pred.val of the regression in the > procD.allometry() function output [in contrast to PC values]? > > Any help on how to approach coding these circumstances or any explicative > literature on the topic would be greatly appreciated. > > > Best wishes, > Javier > > > -- MORPHMET may be accessed via its webpage at http://www.morphometrics.org --- You received this message because you are subscribed to the Google Groups "MORPHMET" group. To unsubscribe from this group and stop receiving emails from it, send an email to morphmet+unsubscr...@morphometrics.org.