Identify data type (Fourier coefficients or Procrustes shape coordinates) and arrange them in 2-margin matrix format, suitable to be used as input for multivariate analysis. Used internally.
shapes_mat(shapes)
Shape data.
A list of length 2 containing:
$datype:
the type of geometric morphometrics data.
$data2d:
the shape descriptors arranged in 2-margins matrix
format.
#apply on shells dataset
data("shells")
dat1 <- shapes_mat(shells$shapes)
#inspect results
head(dat1$data2d)
#> A1 A2 A3 A4 A5 A6
#> b1'_V76-1 1 0.009847538 0.08337886 0.0039761185 0.02061273 -1.493843e-03
#> b1_A12 1 0.005227513 0.07848772 0.0016269021 0.02297933 -8.905190e-04
#> b2'_SS-1 1 0.018904335 0.05939487 0.0070442907 0.01232883 -4.544465e-04
#> b3'_SS-1 1 0.014621832 0.06036253 0.0077918975 0.01006870 1.105021e-05
#> b3_SS-1 1 0.010326194 0.06160285 0.0063514712 0.01487457 -3.071751e-04
#> b4_SM-1 1 0.008975320 0.06233609 -0.0003651647 0.01547282 -3.668517e-03
#> A7 B1 B2 B3 B4 B5
#> b1'_V76-1 0.006759703 0 0.005477003 -0.0004282486 0.007548908 0.0031221174
#> b1_A12 0.007257191 0 0.003898250 -0.0013499495 0.002620121 0.0020050185
#> b2'_SS-1 0.003813116 0 0.012513634 -0.0030524433 0.009411656 0.0010909600
#> b3'_SS-1 0.004184113 0 0.004258217 -0.0004140345 0.009201703 0.0032509225
#> b3_SS-1 0.005676455 0 0.006581695 -0.0037489167 0.008928932 -0.0009955374
#> b4_SM-1 0.005186795 0 0.009181395 -0.0072017359 0.007766999 -0.0012590531
#> B6 B7 C1 C2 C3 C4
#> b1'_V76-1 0.003957684 0.004562953 0 -0.023541385 -0.0137809936 -0.006797454
#> b1_A12 -0.000151154 0.003844865 0 -0.003775977 -0.0021316512 0.002401863
#> b2'_SS-1 0.002831598 0.004416039 0 -0.021876723 0.0002256957 0.001371427
#> b3'_SS-1 0.005464510 0.003906159 0 -0.013090925 -0.0086135709 -0.009156263
#> b3_SS-1 0.006066773 0.003039227 0 -0.012581691 0.0006289140 -0.005505342
#> b4_SM-1 0.002473577 0.004066889 0 -0.007252402 0.0069228496 -0.002269362
#> C5 C6 C7 D1 D2
#> b1'_V76-1 -0.007410706 0.0036610861 -0.0021926533 -0.4865601 0.04072481
#> b1_A12 -0.006741918 0.0009087822 -0.0007208580 -0.5584802 0.01815055
#> b2'_SS-1 -0.007516363 0.0055458164 -0.0010375766 -0.6637269 0.03425628
#> b3'_SS-1 -0.002344967 0.0047095837 -0.0002979632 -0.6123409 0.03615464
#> b3_SS-1 -0.004058954 0.0030298986 -0.0042394265 -0.6378733 0.02436445
#> b4_SM-1 -0.009670589 0.0061847940 -0.0034557927 -0.6374301 0.01343262
#> D3 D4 D5 D6 D7
#> b1'_V76-1 -0.05334240 -0.018620903 -0.016711541 -0.0018302451 -0.0101989230
#> b1_A12 -0.03919417 -0.009443359 -0.013480105 0.0021323640 -0.0075179404
#> b2'_SS-1 -0.04771922 -0.017937411 -0.005135133 0.0001936624 -0.0070389526
#> b3'_SS-1 -0.06635582 -0.013844481 -0.002831830 -0.0029792588 -0.0005790466
#> b3_SS-1 -0.04477262 -0.007091290 -0.005358318 -0.0025769483 -0.0025821962
#> b4_SM-1 -0.04797558 -0.013992735 -0.004527085 0.0032399782 -0.0054770544
dat1$datype
#> [1] "fcoef"
#aply on tails dataset
data("tails")
dat2 <- shapes_mat(tails$shapes)
#inspect results
head(dat2$data2d)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> 1 0.3086977 -0.06602077 0.3086977 0.06602080 0.2657952 -0.07281554 0.2657952
#> 2 0.3022522 -0.06086812 0.3022522 0.06086816 0.2628490 -0.06628239 0.2628490
#> 3 0.3174438 -0.06501373 0.3174437 0.06501377 0.2746603 -0.07049607 0.2746603
#> 4 0.3235606 -0.06498776 0.3235606 0.06498779 0.2800004 -0.07368902 0.2800004
#> 5 0.3226869 -0.07235632 0.3226869 0.07235635 0.2743744 -0.08160505 0.2743744
#> 6 0.3016127 -0.06416951 0.3016127 0.06416954 0.2599461 -0.06984898 0.2599461
#> [,8] [,9] [,10] [,11] [,12] [,13]
#> 1 0.07281557 -0.4314970 -0.3981329 -0.1431885 -0.1804893 0.0003851696
#> 2 0.06628242 -0.4172909 -0.4256825 -0.1353013 -0.1713835 -0.0250179246
#> 3 0.07049610 -0.4487546 -0.3770543 -0.1329245 -0.1732373 -0.0208498079
#> 4 0.07368904 -0.4443929 -0.3670732 -0.1407361 -0.1624070 -0.0368638304
#> 5 0.08160507 -0.4602320 -0.3545009 -0.1422530 -0.1817729 0.0108474699
#> 6 0.06984900 -0.4111111 -0.4102675 -0.1428489 -0.1957890 -0.0151975144
#> [,14] [,15] [,16] [,17] [,18]
#> 1 -2.906798e-08 -0.1431885 0.1804893 -0.4314970 0.3981329
#> 2 -2.539334e-08 -0.1353014 0.1713834 -0.4172910 0.4256825
#> 3 -3.002987e-08 -0.1329245 0.1732372 -0.4487547 0.3770543
#> 4 -2.442124e-08 -0.1407362 0.1624070 -0.4443930 0.3670733
#> 5 -3.931407e-08 -0.1422530 0.1817729 -0.4602320 0.3545009
#> 6 -2.052660e-08 -0.1428490 0.1957889 -0.4111111 0.4102675
dat2$datype
#> [1] "landm"