-------- Original Message --------
Subject: RE: tps format problem reading in R
Date: Wed, 3 Jul 2013 11:32:55 -0400
From: Adams, Dean [EEOBS] <dcad...@iastate.edu>
To: morphmet@morphometrics.org <morphmet@morphometrics.org>

Hi John,

There were two issues here, and both of which have easy fixes. First, there is only 1 specimen in your tps file, and the current version of readland.tps() was written for datasets with more than one specimen (we didn't envision folks reading in a single specimen for a morphometric analysis). This is easily fixed by changing the 3rd to last line of the function as below. Next, your file had a non-numeric ID for the specimen. To catch this, change the 4th to last line of the function as below. These two lines should now read:

ID <-sub("ID=", "", tpsfile[grep("ID", tpsfile)])   #delete the 'as.numeric'
dimnames(coords)[[3]] <- as.list(imageID)   # add 'as.list'


The updated function code is attached, and will be in the next update of geomorph.

Thanks for catching these; this makes the function more general.

Best,

Dean

--
Dr. Dean C. Adams
Professor
Department of Ecology, Evolution, and Organismal Biology Department of Statistics Iowa State University Ames, Iowa
50011
www.public.iastate.edu/~dcadams/
phone: 515-294-3834


-----Original Message-----
From: morphmet_modera...@morphometrics.org [mailto:morphmet_modera...@morphometrics.org]
Sent: Wednesday, July 03, 2013 1:31 AM
To: morphmet@morphometrics.org
Subject: tps format problem reading in R


----- Forwarded message from John Denton <jden...@amnh.org> -----

     Date: Tue, 2 Jul 2013 23:04:22 -0400
      From: John Denton <jden...@amnh.org>
      Reply-To: John Denton <jden...@amnh.org>
      Subject: tps format problem reading in R
      To: "morphmet@morphometrics.org" <morphmet@morphometrics.org>

Hi folks,

I'm trying to read a tps file in the geomorph v1.1-1 R package using

readland.tps("file"),

but every time I try the above, I get the error

Error in dimnames(coords)[[3]] <- imageID : 'dimnames' must be a list In addition: Warning message:
In readland.tps("Lter_mean.TPS") : NAs introduced by coercion

I do not get the error when I read in some of my other tps files (all of which were produced using append files in tpsUtil). The file I'm trying to read in is the side-averaged Procrustes coordinates, generated in MorphoJ.

I've checked the hidden formatting, the line breaks, the number of decimal places, and the file extension, but I can't seem to figure it out.

The file is attached.

~John

John S. S. Denton
Ph.D. Candidate
Department of Ichthyology and Richard Gilder Graduate School American Museum of Natural History www.johnssdenton.com

----- End forwarded message -----



Attachment: readland.tps
Description: Binary data

Reply via email to