Hard to tell why it is not working for you.
Assuming that you have the specimens "stacked" one on top of each other, each of them with 30 landmarks in 2D, it should work changing the relevant parameters. My suggestion to you would be to carefully check what these two lines are doing

data$specimen=as.factor(unlist(lapply(seq_len(landmarks), function(x) rep(seq_len(landmarks)[x],30))))
data$landmark=as.factor(rep(1:30,30))

As they comprise various nested calls, you might find it useful to try on the nested part first and then run the whole call. If checking data$specimen and data$landmark you get indeed the right number of rows and the right names, I don't see why the reshaping shouldn't work.

I hope this helps.
Carmelo


On 12/08/2018 22:33, Ian F wrote:
im sorry to ask so many questions. How would I reformat the script you have provided to convert 2686 observations of 2 variables (x and y coordinates) into wide format? when i try to alter it i end up with millions of rows.

On Thursday, August 2, 2018 at 1:32:02 PM UTC-4, Ian F wrote:

    I am trying to do an analysis of three specimens. I am using
    semi-landmarks and having trouble. perhaps someone can point out mt
    error? these are my results

    Generalized Procrustes Analysis
    with Partial Procrustes Superimposition

    -4 fixed landmarks
    12 semilandmarks (sliders)
    2-dimensional landmarks
    6 GPA iterations to converge
    Minimized Bending Energy used


    Consensus (mean) Configuration

                    X           Y
    [1,]  0.51447153 -0.03794928
    [2,]  0.36957021  0.11431610
    [3,] -0.11602250  0.19898458
    [4,] -0.40489951  0.11095030
    [5,] -0.43738229 -0.09965594
    [6,] -0.20913543 -0.09698422
    [7,]  0.04257626 -0.09131803
    [8,]  0.29799009 -0.04811314

    it should be three individuals with 4 landmarks and 4 sliders each.
    i want to perform PCA on the procrustes coordinates. my code and
    data are below. Im new to R and its probably an easy fix im just
    really confused. any help is greatly appreciated.






    Code:    Y <- arrayspecs(coordsrformat, k=2, p= ncol(coordsrformat)/2)

    slidermatrix

    Y.gpa <- gpagen(Y,curves=slidermatrix)
    summary(Y.gpa)
    plot(Y.gpa)

    Y.gpa <- gpagen(Y,curves=slidermatrix,ProcD=FALSE )
    summary(Y.gpa)
    plot(Y.gpa)
    a<-(Y.gpa$coords)
    plotTangentSpace(a)




    slider matrix:

    before        slide after
    5        6        7
    7        8        1
    1        2        3
    3        4        5
    1        8        7
    7        6        5
    5        4        3
    3        2        1
    1        2        3
    3        4        5
    5        6        7
    7        8        1


    coordsrformat:


    1630        1827        1530       1549        1198
    1345        908        1557      833        1840
    1027        1895        1223       1907        1417 1887
    2767        1081        2633       1581        2139
    2047        1693        1753       1535        1159
    1841        1067        2151       1009        2437 1071
    2956        928        2936      1692        2112
    2360        1300        1784       1304        1016
    1700        888        2084      832        2480 872



--
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 morphmet+unsubscr...@morphometrics.org <mailto:morphmet+unsubscr...@morphometrics.org>.

--


==================
Carmelo Fruciano
Institute of Biology
Ecole Normale Superieure - Paris
CNRS
http://www.fruciano.it/research/

--
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 morphmet+unsubscr...@morphometrics.org.

Reply via email to