Dear Emma and Andrea, Thanks for the rescue. I'll give this a try. I don't really know much about code so some of the syntax is confusing to me, but this looks to be an explanation I can follow after a few tries. Thank you so much.
Best, Ari On Tue, Jan 19, 2016 at 11:08 AM, Emma Sherratt <[email protected]> wrote: > Dear Ari, > > geomorph uses the following code to write an .nts from the digtizing > functions. It's an .nts file for single specimens > > # Write .nts file for output of digitize2d(), buildtemplate() > digit.fixed() and digitsurface() > # A is an nx2 or nx3 matrix of the output coordinates. To be used > internally only. > > writeland.nts <- function(A, spec.name, comment=NULL){ > ntsfile=paste(spec.name,".nts",sep="") > file.create(file=ntsfile) > if(is.null(comment)){ > cat(paste('"',spec.name,sep=""),file= ntsfile,sep="\n",append=TRUE) > } > else if(!is.null(comment)){ > cat(paste('"',spec.name,sep=""),file= ntsfile,sep="\n") > cat(paste('"',comment,sep=""),file= ntsfile,sep="\n",append=TRUE) > } > dims <- dim(A) > if (dims[2] == 2){ > cat(paste(1,dims[1],2,0,"dim=2"),file= ntsfile,sep="\n",append=TRUE) > } > else if (dims[2] == 3){ > cat(paste(1,dims[1],3,0, "dim=3"),file= ntsfile,sep="\n",append=TRUE) > } > write.table(A ,file= ntsfile,col.names = FALSE, row.names = FALSE,sep=" > ",append=TRUE) > } > > Emma > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Emma Sherratt, PhD. > > Lecturer in Zoology, > Zoology Division, School of Environmental and Rural Science, > Room L112 Bldg C02, > University of New England, > Armidale, NSW, Australia, 2351 > Tel: +61 2 6773 5041 > email: [email protected] > Twitter: @DrEmSherratt > > Caecilians are legless amphibians... > > * __ > (\ .-. .-. /_") > \\_//^\\_//^\\_// > `"` `"` `"`* > > learn more about them here: www.emmasherratt.com/caecilians > > > > > On 19 January 2016 at 20:19, Ariadne Schulz <[email protected]> > wrote: > >> Hi all, >> >> I'm hoping this will be a quick and easy question. I've even done it >> before and then forgotten how. >> >> I need to create quite a few .nts files. The easiest way to do this I >> think is in R. I read in my .dta file, got my landmarks all switched the >> way I want them but now for each of my elements I need to create a .nts >> file. I've searched about online and the only things I could find were how >> to read a .nts file and the "digitize" functions. I know it's possible to >> simply write .nts files, because I have done it before ... but I've >> forgotten what I did. >> >> Help? >> >> Best, >> Ari >> >> -- >> MORPHMET may be accessed via its webpage at http://www.morphometrics.org >> --- >> You received this message because you are subscribed to the Google Groups >> "MORPHMET" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> > > -- MORPHMET may be accessed via its webpage at http://www.morphometrics.org --- You received this message because you are subscribed to the Google Groups "MORPHMET" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
