geomorphR / geomorph

Geomorph is a software package for performing all stages of geometric morphometric shape analysis of landmark points and curves in 2-and-3-dimensions as well as 3D surfaces in the R statistical computing environment. This repository is dedicated to providing stable and beta versions between CRAN uploads
73 stars 20 forks source link

Error using interlmkdist #23

Closed sjm5467 closed 4 years ago

sjm5467 commented 5 years ago

Below is my data matrix for an individual fish and the code for the matrix of landmarks. When I run the code: results<-interlmkdist(fish4.my.matrix, lmks.fish) I get the following error: Error in if (d2 == 0L) { : missing value where TRUE/FALSE needed Nowhere in the help is there an indication that I need to specify a T/F condition.

3D landmark matrix [,1] [,2] [,3] [1,] 17.05520 15.74733 47.53114 [2,] 18.24270 16.37591 13.80993 [3,] 18.26952 14.62078 36.91296 [4,] 17.47745 14.66896 45.51792 [5,] 17.81121 14.29797 42.46868 [6,] 19.19132 15.18134 44.18545 [7,] 16.22816 14.19615 43.82030 [8,] 18.85477 17.90548 44.49008 [9,] 17.74299 15.93717 46.60321 [10,] 12.22052 16.57722 41.40556 [11,] 21.12792 16.40635 40.99355 [12,] 16.60012 14.49540 45.99598 [13,] 17.00166 14.45665 45.33425 [14,] 13.73537 14.54041 43.24696 [15,] 22.47910 18.22723 36.52447 [16,] 12.33789 16.22062 35.58069 [17,] 15.76807 15.12796 47.85163 [18,] 14.03573 14.53654 44.37166 [19,] 12.28796 16.51153 34.48584 [20,] 20.55820 16.84872 15.26186 [21,] 11.95594 17.67173 28.60648 [22,] 15.20270 17.18918 15.73366 [23,] 15.17435 16.65157 14.40329 [24,] 20.62033 16.92799 13.72122 [25,] 20.59991 16.83949 14.25169 [26,] 15.31551 16.77876 14.41184 [27,] 18.27195 16.41246 16.59344

Code for landmark matrix: lmks.fish<-matrix(c(1,2,1,3,1,4,5,3,4,5,6,7,6,8,12,13,1,9,7,14,17,18,10,11,15,16,1,15,1,19,15,20,15,21,15,22,20,21,20,22,20,23,22,24,15,19,20,19,27,2,25,26), ncol=2, byrow=TRUE, dimnames=list(c("SL", "HL", "SNL", "POHL", "HED", "VED", "IW", "PRE", "PREM", "CD", "LJL", "HD", "BD", "SNDOR", "SNPEL", "DFBL", "ADAA", "ADPA", "PDAA", "PDPA", "PDVC", "PADC", "ADP2", "PDP2", "CPL", "LCPD"),c("start", "end")))

deanadams commented 5 years ago

You only have 1 specimen in your 3D array; the function assumes several. Try this:

fish4.my.matrix <- arrayspecs(A = rbind(as.vector(spec),as.vector(spec)),p = 27,k=3)

Dean

Dr. Dean C. Adams Director of Graduate Education, EEB Program Professor Department of Ecology, Evolution, and Organismal Biology Iowa State University https://www.eeob.iastate.edu/faculty/adams/ phone: 515-294-3834

From: sjm5467 notifications@github.com Sent: Wednesday, February 20, 2019 1:05 PM To: geomorphR/geomorph geomorph@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [geomorphR/geomorph] Error using interlmkdist (#23)

Below is my data matrix for an individual fish and the code for the matrix of landmarks. When I run the code: results<-interlmkdist(fish4.my.matrix, lmks.fish) I get the following error: Error in if (d2 == 0L) { : missing value where TRUE/FALSE needed Nowhere in the help is there an indication that I need to specify a T/F condition.

3D landmark matrix [,1] [,2] [,3] [1,] 17.05520 15.74733 47.53114 [2,] 18.24270 16.37591 13.80993 [3,] 18.26952 14.62078 36.91296 [4,] 17.47745 14.66896 45.51792 [5,] 17.81121 14.29797 42.46868 [6,] 19.19132 15.18134 44.18545 [7,] 16.22816 14.19615 43.82030 [8,] 18.85477 17.90548 44.49008 [9,] 17.74299 15.93717 46.60321 [10,] 12.22052 16.57722 41.40556 [11,] 21.12792 16.40635 40.99355 [12,] 16.60012 14.49540 45.99598 [13,] 17.00166 14.45665 45.33425 [14,] 13.73537 14.54041 43.24696 [15,] 22.47910 18.22723 36.52447 [16,] 12.33789 16.22062 35.58069 [17,] 15.76807 15.12796 47.85163 [18,] 14.03573 14.53654 44.37166 [19,] 12.28796 16.51153 34.48584 [20,] 20.55820 16.84872 15.26186 [21,] 11.95594 17.67173 28.60648 [22,] 15.20270 17.18918 15.73366 [23,] 15.17435 16.65157 14.40329 [24,] 20.62033 16.92799 13.72122 [25,] 20.59991 16.83949 14.25169 [26,] 15.31551 16.77876 14.41184 [27,] 18.27195 16.41246 16.59344

Code for landmark matrix: lmks.fish<-matrix(c(1,2,1,3,1,4,5,3,4,5,6,7,6,8,12,13,1,9,7,14,17,18,10,11,15,16,1,15,1,19,15,20,15,21,15,22,20,21,20,22,20,23,22,24,15,19,20,19,27,2,25,26), ncol=2, byrow=TRUE, dimnames=list(c("SL", "HL", "SNL", "POHL", "HED", "VED", "IW", "PRE", "PREM", "CD", "LJL", "HD", "BD", "SNDOR", "SNPEL", "DFBL", "ADAA", "ADPA", "PDAA", "PDPA", "PDVC", "PADC", "ADP2", "PDP2", "CPL", "LCPD"),c("start", "end")))

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/geomorphR/geomorph/issues/23, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGSvqbT8OkcIFGi6MES0NSPq7hh64M7Jks5vPZxqgaJpZM4bF56l.

mlcollyer commented 5 years ago

I have updated the script to detect and adjust a single matrix of landmarks to be an array. It should work now, but please check with your example.

Mike

sjm5467 commented 5 years ago

I do ultimately want to run this on multiple specimens, I just can't figure out the data format to handle multiple specimens. Therefore, I tried it on a single individual (my mistake). My data comes in the format of the attached excel file (which I use as a csv). I read in the csv and convert to a matrix. I cannot figure how to separate individuals within the matrix (i.e. in your plethodon data, $land). I know this is a novice question. Diving in head first.

mintermed_101079_3.xlsx

deanadams commented 5 years ago

See help file of arrayspecs.

Dean

Get Outlook for Androidhttps://aka.ms/ghei36


From: sjm5467 notifications@github.com Sent: Wednesday, February 20, 2019 7:40:42 PM To: geomorphR/geomorph Cc: Adams, Dean [EEOBS]; Comment Subject: Re: [geomorphR/geomorph] Error using interlmkdist (#23)

I do ultimately want to run this on multiple specimens, I just can't figure out the data format to handle multiple specimens. Therefore, I tried it on a single individual (my mistake). My data comes in the format of the attached excel file (which I use as a csv). I read in the csv and convert to a matrix. I cannot figure how to separate individuals within the matrix (i.e. in your plethodon data, $land). I know this is a novice question. Diving in head first.

mintermed_101079_3.xlsxhttps://github.com/geomorphR/geomorph/files/2887260/mintermed_101079_3.xlsx

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/geomorphR/geomorph/issues/23#issuecomment-465826852, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGSvqeZSNpuBt4q1u-e0CbOvgwxHzsBSks5vPfkagaJpZM4bF56l.