Pere,

>From what I can see it's a simple mistype:

for(i in 1:100){
equi[,,i]<-digit.curves(allcurves[1,,i], allcurves[,,i], 20, closed=F)
}

You need two commas in both brackets because you are working with a 3D
array. I have been very busy marking exams which is why I didn't answer you
sooner on the geomorph blog.

Emma

On Monday, 9 November 2015, Pere Ibáñez <[email protected]> wrote:

> Hello everybody,
>
> I need to ask something in relation to digit.curves in R package geomorph,
> because I think that there must be a really fast way to do something that I
> was going to do specimen by specimen.
>
> I created a (p x k x n) array using readland.tps from a tps file
> containing coordinates of a curve in n=100 specimens (this array is called
> allcurves). Now I want to use digit.curves to find 20 equidistant
> semilandmarks in the curve of each specimen defined by the coordinates of
> my array allcurves.
>
> I can use a for loop for that. But the start point of the curve of each
> specimen is different. The start point of each curve is the first row (the
> first landmark) of each specimen in the array allcurves. Is there any way,
> using the for loop, to use the first row of each specimen as the start
> point for each curve? I tried this:
>
> equi<-array(NA, dim=c(22,3,100)) #22 because I want to get the start and
> end points and 20 equidistant points in the outcome
>
> for(i in 1:100){
> equi[,,i]<-digit.curves(allcurves[1,i], allcurves[,,i], 20, closed=F)
> }
> This error occurs: Error in allcurves[1, i] : incorrect number of
> dimensions
>
> I know this happens because I am not getting right how to tell the program
> to use the first row of each specimen of the array as start point for each
> curve. Is there any way to do this? It would be extremely time-saving for
> my analyses.
>
> Thank you so much in advance. I really appreciate any advise!
>
> --
> MORPHMET may be accessed via its webpage at http://www.morphometrics.org
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:;>.
>


-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org

To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].

Reply via email to