There are several issues here; primarily in the format of your TPS file.
First, you need to remove extraneous information after scale; specifically " PIXELS = 1 MM" . A simple ‘find/replace’ will let you do this in any text editor. Once removed the file will read into geomorph correctly.
Then you need to ‘link up’ the classifier data with the specimens. This requires names in both files which are identical. Your names are in the image names, but you need to remove some things, such as the path, and the ‘.gif’. Also, note that in the TPS file images had a space in the names ‘APR 001’ while in the classifier they did not ‘APR001’. These must be the same in both or you cannot link up the classifiers with the landmark data.
I did a quick fix of your file to read it in and reproduce the gpagen image you had. From this I suspect that orientation of your specimens under the camera was not the issue. Instead, I suspect that some specimens are flipped relative to others (righties and
lefties). This looks to be the case visually, and when I examine the maximal shape distance between specimens, it is enormous, and not biologically reasonable.
Another possibility is that you digitized some landmarks out of order; meaning that the homology of landmarks between specimens is not the same (landmark 4 is now thought to be landmark 5 for instance).
I suggest you examine all of these digitizing issues, then try running things in the script below. After that, linking up the shape data with other variables can be accomplished using hints in the geomorph user guide:
Best, Dean
##
library(geomorph)
mydata<-readland.tps("Field 13 LM test1.txt", specID = "imageID")
classifier<- read.csv("Specimen grouping.csv", header=T)
gpa.res<-gpagen(mydata)
plotAllSpecimens(gpa.res$coords)
max(dist(two.d.array(gpa.res$coords))) #huge maximal Procrustes distance. Something not right in digitizing
dim(gpa.res$coords) #241 individuals
dim(classifier) #244 rows
Dr. Dean C. Adams
Professor
Department of Ecology, Evolution, and Organismal Biology
Department of Statistics
Iowa State University
www.public.iastate.edu/~dcadams/
phone: 515-294-3834
--
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 post to this group, send email to
geomorph-...@googlegroups.com.
Visit this group at
https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/geomorph-r-package/074d7ad1-49b4-4807-bf3c-c61e13c74168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Incidentally, if you can identify which are rights and you wish to flip them to be lefts, that is easy: just multiply one of the coordinates (x or y) by -1 for those specimens. An example below:
Mydata[,1,which(side=="r")] <- Mydata[,1,which(side=="r")]* -1 vv#reflect 'g'
This last line reflects the x-coordinates of all right-specimens to now be left-looking specimens, where:
Mydata = a 3D array of landmark coordinates for the specimens
Side = a vector of R and L for each specimen
Dean
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/074d7ad1-49b4-4807-bf3c-c61e13c74168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to
geomorph-...@googlegroups.com.
Visit this group at
https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/02e1025d-e6a4-487b-9369-f4bbcc7709b8%40googlegroups.com.
A few other thoughts for identifying the rights and lefts.
First, one could try plotOutliers, which plots Procrustes distances from each specimen to the average. If only a few specimens are rights and the rest are lefts, the average should be closer to the lefts, and the few right-handed specimens will show up as the largest outliers.
Second, one could take the gpa-aligned specimens and plot them one at a time. There you will be able to see which ones look ‘flipped’ relative to the others.
Generally, it is more cumbersome to identify these issue post-digitizing, but it is possible.
Dean
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/074d7ad1-49b4-4807-bf3c-c61e13c74168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to
geomorph-...@googlegroups.com.
Visit this group at
https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/02e1025d-e6a4-487b-9369-f4bbcc7709b8%40googlegroups.com.
Fig1: 2D raw landmarks (z-axis removed) - red dot is the same LM tracked across all three figures.
Fig 2: 2D coordinates after GPA for the same individual in Fig 1.
Fig 3: 2D mean shape for the group that individual 6 belongs. Notice the mean shape is flipped (position of the red dot) in relation to Fig 2. All GPA 2D coordinates from all individuals from this group are oriented as in Fig 2, so why is the mean shape flipped?
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/074d7ad1-49b4-4807-bf3c-c61e13c74168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
The GPA function in geomorph will not automatically reflect specimens during the analysis (one form of flipping). What I meant in my earlier post was that some of the specimens may be digitized as R or L. Combining them makes little sense in their original; one must reflect them prior to GPA.
Note that your 2D view of these by simply excising the Z coordinate is not a perfect way to see any issues, because GPA will rotate in all 3 dimensions. Thus the X,Y,Z axes are not the same before and after GPA.
I suggest you examine closely your original specimens to ensure that they are not ‘righties’ and ‘lefties’ before combining them and submitting them to a GPA.
Dean
Dr. Dean C. Adams
Director of Graduate Education, EEB Program
Professor
Department of Ecology, Evolution, and Organismal Biology
Department of Statistics
Iowa State University
www.public.iastate.edu/~dcadams/
phone: 515-294-3834
Hi all,
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/074d7ad1-49b4-4807-bf3c-c61e13c74168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/02e1025d-e6a4-487b-9369-f4bbcc7709b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to
geomorph-...@googlegroups.com.
Visit this group at
https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/ae159f19-a702-44e0-b65d-1b0033bbe052%40googlegroups.com.
Hi all,
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/074d7ad1-49b4-4807-bf3c-c61e13c74168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/02e1025d-e6a4-487b-9369-f4bbcc7709b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To post to this group, send email to geomorph-...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/28b6a33a-1845-42a1-adbe-eae015424df7%40googlegroups.com.
Mike
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/183273ca-d08e-46ef-b998-ae0eb4ca54da%40googlegroups.com.
Mike caught an important component that I missed in your posts: the separate GPA. Definitely do not do this. Instead, a single GPA of all specimens followed by subsetting as Mike suggested is what is appropriate.
Note also that one can obtain the group means from an anova model using advanced.procD.lm. That is yet another approach to getting where you wish to be.
Good luck,
Dean
Dr. Dean C. Adams
Director of Graduate Education, EEB Program
Professor
Department of Ecology, Evolution, and Organismal Biology
Department of Statistics
Iowa State University
www.public.iastate.edu/~dcadams/
phone: 515-294-3834
Mike
Hi all,
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/074d7ad1-49b4-4807-bf3c-c61e13c74168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/02e1025d-e6a4-487b-9369-f4bbcc7709b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/ae159f19-a702-44e0-b65d-1b0033bbe052%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/28b6a33a-1845-42a1-adbe-eae015424df7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/183273ca-d08e-46ef-b998-ae0eb4ca54da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to
geomorph-...@googlegroups.com.
Visit this group at
https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/86C492D7-CBEF-476F-81B0-0FDB5C6CB2A7%40gmail.com.
Mike
Hi all,
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/074d7ad1-49b4-4807-bf3c-c61e13c74168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/02e1025d-e6a4-487b-9369-f4bbcc7709b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/ae159f19-a702-44e0-b65d-1b0033bbe052%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/28b6a33a-1845-42a1-adbe-eae015424df7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/183273ca-d08e-46ef-b998-ae0eb4ca54da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.