Dear Geomorph Group,
I wrote a script using geomorph in R that I planned to publish as part of a study in order for other researchers to modify and expand upon with their own data. Unfortunately, I had to reinstall geomorph due to an unrelated computer problem, and when I reinstalled geomorph I found that my old code would no longer work due to the plotTangentSpace function being depreciated.
I know how to run an analogous analysis by using the gm.prcomp function, but one thing I found is that the new gm.prcomp function (including plot.gm.prcomp) does not produce the summary figure that plotTangentSpace does. I found the old plotTangentSpace function to be very useful in providing an initial summary graphic of the first two axes and their extreme shapes, even if I ended up using a more customized graphic for actual publication. Plot.gm.prcomp does not provide an easy way to color-code datapoints by adding an additional argument the way plotTangentSpace did with the "labels" argument, and it does not provide the helpful deformation grids showing the minima and maxima shapes of each axis the way plotTangentSpace did. The attached picture is the result I get when I try to plot the results of a gm.prcomp object in R.
I realize I could probably replicate the results of plotTangentSpace using ggplot2 and plotReftoTarget, but I am trying to figure out if there is an easier way to replicate the results of this deprecated function without writing up a new, complex code in ggplot2() or plot(). Alternatively if there is no other option, does anyone know a way to replicate the way the old summary figure function worked?
Sincerely,
Russell
Russell,
I believe the answers to all your questions are included in the
gm.prcomp help page, including examples of how to colour code
observations depending on a grouping variable. The extremes of the
PC axes can be plotted using plotRefToTarget. More extensive
explanations are included in the vignette "geomorp.PCA", just run:
vignette("geomorph.PCA"). The rest is learning how to control
layout() and arrows() and you can make a plot exactly like those
previously made by plotTangentSpace, and much more.
gm.prcomp substituted plotTangentSpace PRECISELY to allow users
to customize the plots whichever way they want.
Good luck!
Antigoni
--
You received this message because you are subscribed to the Google Groups "geomorph R package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/5b971e16-f5f3-4689-a6c5-ec16404b9945n%40googlegroups.com.
-- Antigoni Kaliontzopoulou Auxiliary Researcher CIBIO/InBIO, Centro de Investigação em Biodiversidade e Recursos Genéticos University of Porto Campus Agrário de Vairão, 4485-661 Vairão PORTUGAL https://sites.google.com/view/akaliontzopoulou/home https://cibio.up.pt/research-groups-1/details/phenevol http://cibio.up.pt/people/details/akaliont http://www.seh-herpetology.org/
Russell,
I am sorry to hear that you are unhappy with the changes
implemented in geomorph. I can assure you that this is not a
personal conspiracy of the geomorph team against you, but rather
an intent to improve the routines implemented by the package and
make it more flexible for more users. As is frequently the case in
package development, it is not possible to make everyone happy.
Note that the transition from plotTangentSpace to gm.prcomp was
implemented to add a whole suite of analytical techniques to the
package, and are not merely related to plotting. Nevertheless,
also note that plot.gm.prcomp is an S3 function, meaning that one
is able to pass any arguments that work in the base plot()
function, thus providing full control for plotting.
As for your particular case, I am not sure what to recommend.
ggplot is not my field, so I cannot help there. If this is a
one-case issue, you can try reverting back to an older version of
geomorph that does have plotTangentSpace in it, and maybe even
grabbing the code from that function so you do not have to
re-write it yourself. Beware, however, that if you revert back you
may need to also revert your R version or those of other packages,
and that any corrections implemented since will not be available.
This Rstudio article can be useful in that direction, and in
understanding the implications, of installing an older version of
any R package:
https://support.rstudio.com/hc/en-us/articles/219949047-Installing-older-versions-of-packages
Otherwise, I am sorry to say that this is the world of R: package developers make decisions and updates (the R-base package included) and the rest of us need to adapt to those changes.
Good luck with your article
Antigoni
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/a097ab9e-667e-4566-8b97-6be73dc0a7ddn%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/92c8d356-a099-245d-0886-2607bb0bf4e3%40cibio.up.pt.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/CA%2BxQ-HSxXLymvcU3pzM0T6MdWdCsYr-ajqysStrHuQCnE%3DC8Pw%40mail.gmail.com.
Russell,
The tone of your discourse is entirely inappropriate for a public forum, and will not be tolerated.
We write and maintain geomorph as a volunteer effort for the community; it is not a part of our paid jobs. And as all R-users know, package maintainers have the duty to update their packages as base-R makes changes, and to make additional enhancements as they
see fit.
If you are unhappy with the current version of geomorph, simply use the old one or write your own package.
Dean
geomorph creator and maintainer
Dr. Dean C. Adams
Director of Graduate Education, EEB Program
Professor
Department of Ecology, Evolution, and Organismal Biology
Iowa State University
https://www.eeob.iastate.edu/faculty/adams/
phone: 515-294-3834
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/a097ab9e-667e-4566-8b97-6be73dc0a7ddn%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/53c9f75cfaf54c31b368efade0fc2a4b%40ebc.uu.se.