0

I recently updated my MacBook air (2017) to the Mojave OS and proceeded to update my version of R and Rstudio. Unfortunately, ever since the 'plotTangentSpace' command no longer functions appropriately even when attempting to run the example 'plethodon' code from the Geomorph vingette, I always receive the following error in the output (bolded below):

data(plethodon)
Y.gpa<-gpagen(plethodon$land) #GPA-alignment |====================================================================================| 100%
gp <- interaction(plethodon$species, plethodon$site)
plotTangentSpace(Y.gpa$coords, groups = gp)
Error in plotTangentSpace(Y.gpa$coords, groups = gp) : unused arguments (Y.gpa$coords, groups = gp)

I have tried uninstalling and reinstalling R for a MacOS many times including versions 4.0.2, 3.6.3, 3.6.1, and 3.2.1. I have also uninstalled and reinstalled XQuartz several times.

If anyone has encountered a similar issue or has any other ideas I can try I would really appreciate the help. Thank you!

Leila
  • 1
  • You have not posted either a `library` call or the results of `sessionInfo()`, so we don't know if you have a current version and have loaded it inot your workspace. – IRTFM Jun 30 '20 at 22:05

3 Answers3

1

If you execute:

?plotTangentSpace

You should see that this is a deprecated function. That means you should not be using it. It says:

Notes for geomorph 3.3.0 and subsequent versions

I suspect you have not updated your copy of the vignette. There are instructions on the help page for an alternate approach. The example in the help page for the suggested function is:

data(plethspecies) 
 Y.gpa <- gpagen(plethspecies$land)    #GPA-alignment
 
 ###  Traditional PCA 
 PCA <- gm.prcomp(Y.gpa$coords)
 summary(PCA)
 plot(PCA, main = "PCA")

For the plethodon data they suggest:

PCA.w.phylo <- gm.prcomp(Y.gpa$coords, phy = plethspecies$phy)
summary(PCA.w.phylo)
plot(PCA.w.phylo, phylo = TRUE, main = "PCA.w.phylo")

So start a new session (to unload the currently loaded geomorph namespace, and execute this at the r session command line:

install.packages("geomorph")

You should be getting version 3.3.1 of the geomorph package.

IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • Thank you so much for your advice! I had encountered this new function previously, but have not yet had any success with its use. When I run the sample code I get the following error (bolded below):> data(plethspecies) > Y.gpa <- gpagen(plethspecies$land) #GPA-alignment |====================================================================================| 100% > ### Traditional PCA > PCA <- gm.prcomp(Y.gpa$coords) Error in do.call(ordinate, ord.args) : object 'ordinate' not found – Leila Jun 29 '20 at 20:29
  • You should execute `packageDescription("geomorph")`, check the version, and my prediction is that it is out-of-date. – IRTFM Jun 30 '20 at 22:03
  • I really appreciate your help! When I execute that code it looks like the package is up to date (version 3.3.1 in R 3.6.2), I receive the following output: Package: geomorph Title: Geometric Morphometric Analyses of 2D/3D Landmark Data Version: 3.3.1 – Leila Jul 01 '20 at 23:32
1

I think I found the problem! In my case, the error was due to a old version of the package RRPP, which is required by Geomorph. After updating it, Geomorph is working perfectly! Hope this can be useful for you too.

0

I came across the same error but after updating the RRPP and rgl packages required for geomorph, the gm.prcomp() function worked for me. I hope this helps if you haven't figured it out already.