Error in plot.gm.prcomp

157 views
Skip to first unread message

Mariah Schlis-Elias

unread,
Oct 22, 2021, 1:38:24 PM10/22/21
to geomorph R package
Hello!

I am trying to plot the first and second PC axes from a PCA I just ran on the symmetric component of my shape data. When I try to use the function plot.gm.prcomp though, R gives me an error saying it could not find the function even though I have activated geomorph in this R session. I have also double-checked that all my packages are updated and that R and RStudio are updated (so this is geomorph v4.0.1), tried uninstalling and reinstalling geomorph, restarting R, restarting my whole computer, and still no luck.

I am extra confused because I can successfully use the gmShiny app on my local computer and produce PCA plots (which if I understand correctly should rely on plot.gm.prcomp on the back-end), but I cannot use gmShiny for this particular plot since my data has more than ten groups.

Have I missed something, or does this indicate something is wrong with the package?

Any advice would be greatly appreciated!

Mariah

Emanuel Seculi

unread,
Oct 22, 2021, 1:47:30 PM10/22/21
to geomorph-...@googlegroups.com
Hello Marhia, Try with the plot function, for example:
plot(PCA, pch= as.numeric(facto),cex=1.5,pch=19)
Maybe the function plot.gm.prcomp has been deleted in the package.

--
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/cd7b5aed-5350-4dcb-a3cb-f528229069d2n%40googlegroups.com.

Mike Collyer

unread,
Oct 22, 2021, 2:00:38 PM10/22/21
to geomorph R package
The function has not been deleted.  It is an S3 generic function.  One uses

plot(my.PCA)

and not

plot.gm.prcomp(my.PCA)

The “.gm.prcomp” part of the function instructs R when somebody uses plot(), for gm.prcomp class objects.


Also look at the gm.prcomp file, and notice that the examples do not use plot.gm.prcomp, but use plot only.

Best,
Mike

Reply all
Reply to author
Forward
0 new messages