Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Dear morphometricians,

Below you will find an update to our function for digitizing curves in 2d: curves2d(). This solves a problem with the function plotting landmarks and semilandmarks out of sequence. To use it, you can “source()” the code from a directory, or copy and paste it during digitizing.

Cheers,

Erik

 CODE: curves2d<-function(file, nsliders){lm<-readland.nts(spec.name<-basename(file))lm <- matrix(lm, ncol = dim(lm), byrow=T)spec.name<-unlist(strsplit(spec.name, "\\."))plot(lm[,1],lm[,2],cex=1,pch=21,bg=”white”)text(lm[,1],lm[,2],label=paste(“LM”,1:dim(lm)),adj=.5,pos=1)selected<-matrix(NA,ncol=3,nrow=nsliders)select<-NULLfor(i in 1:nsliders){for(j in 1:3){select<-identify(lm,n=1,plot=FALSE,cex=5,pch=25)selected[i,j]<-selectif(j==2){points(lm[select,],lm[select,],cex=1.5,pch=19,col=”red”)arrows(lm[selected[i,j],],lm[selected[i,j],],lm[selected[i,j-1],],lm[selected[i,j-1],],col=”red”,lwd=2,length=.15)} else {points(lm[select,],lm[select,],cex=1.1,pch=19,col=”blue”)}if(j==3){arrows(lm[selected[i,j],],lm[selected[i,j],],lm[selected[i,j-1],],lm[selected[i,j-1],],col=”red”,lwd=2,length=.15,code=1)#lines(rbind(lm[selected[i,j],],lm[selected[i,j-1],]),col=”red”,lwd=2)} else { NA} }}output<-selectedcat(paste(‘”sliders’,sep=””),file=paste(“sliders.nts”,sep=””),sep=”\n”)cat(paste(1,dim(output),3,0, “dim=3″),file=”sliders.nts”,sep=”\n”,append=TRUE)write.table(output,file=”sliders.nts”,col.names = FALSE, row.names = FALSE,sep=” “,append=TRUE)return(list(sliders=output))}