Re: [MORPHMET] digit.curves

2018-08-13 Thread Carmelo Fruciano




On 12/08/2018 22:20, Ian F wrote:
Does digit.curves require data in long on wide format? when i try to use 
it i get the error


  "  Error in digit.curves(2880, Rafalt1, nPoints = 30, closed=TRUE):
   Input must be a p-x-k matrix of curve coordinates"

what is a p-x-k matrix. I have searched it on the internet and have come 
up with nothing.I have tried both long and wide format and have had the 
same result. any help is much appreciated.


I'm not going to go into the details of the specific function call. But 
p by x by k is normally called a (3D) array in R. It's like a "stack of 
matrices" on a third dimension.
If you do a google search for "3D arrays R" (without quote), you'll find 
plenty of stuff to understand how it works, such as

http://aaronlichtner.com/r-a-little-bit-on-multidimensional-arrays-and-apply/
https://www.dummies.com/programming/r/how-to-create-an-array-in-r/
I hope this helps.
Carmelo

--


==
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.



Re: [MORPHMET] Re: Trouble with 2-D morphomeric analysis in geomorph

2018-08-13 Thread Carmelo Fruciano

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:

beforeslide after
567
781
123
345
187
765
543
321
123
345
567
781


coordsrformat:


163018271530   15491198
13459081557  8331840
102718951223   19071417 1887
276710812633   15812139
204716931753   15351159
184110672151   10092437 1071
29569282936  16922112
236013001784   13041016
17008882084  8322480 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 
.


--


==
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.