[adegenet-forum] duplicate locations detected in sPCA
john benson
smilodon2000 at hotmail.com
Mon Nov 28 21:25:58 CET 2011
Hi,
I'm trying to run an sPCA on microsattelite data stored as a GENIND object in adegenet. I've got the data in and it recognizes the xy data as spatial coordinates. However, I am hoping to use a Gabriel Graph as the connection network (Type = 2) and keep getting an error message telling me:
Error in chooseCN(xy = xy, ask = ask, type = type, plot.nb = plot.nb, : Duplicate locations detected and incompatible with graph type 1-4.Please choose another graph (5-7) or add random noise to locations (see ?jitter).
However, I have checked the data and there are no duplicate coordinates. I even checked using the duplicated() function and R did not find any duplicates.
> duplicated(Datum2 at other$xy) [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [97] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE[109] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE[121] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE[133] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE[145] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE[157] FALSE FALSE
I have tried the jitter() function to add additional noise but this didn't help. The spatial data are in Lambert which are metric units similar to UTMS.
My code is as follows:
mySpca<-spca(Datum2, type=2, ask=FALSE, scannf=FALSE)
Any help would be much appreciated!
Thanks,
John BensonPhD Candidate, Trent University
The spatial data look like this:
[,1] [,2] [1,] 1358690 12086700 [2,] 1346840 12099300 [3,] 1343380 12100000 [4,] 1337699 12111573 [5,] 1343380 12100001 [6,] 1359610 12097200 [7,] 1358690 12086701 [8,] 1335017 12085102 [9,] 1359610 12097201 [10,] 1369480 12084800 [11,] 1386141 12100827 [12,] 1344620 12090900 [13,] 1327740 12120600 [14,] 1338520 12105500 [15,] 1344030 12120600 [16,] 1368710 12083800 [17,] 1366550 12094400 [18,] 1374040 12103000 [19,] 1368710 12083801 [20,] 1374040 12103001 [21,] 1344620 12090901 [22,] 1344620 12090902 [23,] 1361250 12104500 [24,] 1366550 12094402 [25,] 1322700 12093301 [26,] 1322700 12093302 [27,] 1361250 12104501 [28,] 1361250 12104502 [29,] 1375160 12094100 [30,] 1368240 12084200 [31,] 1375160 12094101 [32,] 1366550 12094401 [33,] 1335017 12085103 [34,] 1335510 12091900 [35,] 1335510 12091901 [36,] 1344030 12120601 [37,] 1351600 12114500 [38,] 1351600 12114501 [39,] 1327740 12120601 [40,] 1439300 12123800 [41,] 1395347 12140837 [42,] 1395471 12140894 [43,] 1437200 12137800 [44,] 1451450 12123900 [45,] 1444700 12154000 [46,] 1411350 12129200 [47,] 1411200 12104600 [48,] 1434570 12121900 [49,] 1453800 12111500 [50,] 1391720 12129300 [51,] 1436910 12170800 [52,] 1436910 12170801 [53,] 1410830 12146300 [54,] 1431050 12153700 [55,] 1437240 12137800 [56,] 1411350 12129201 [57,] 1391720 12129300 [58,] 1411200 12104601 [59,] 1439300 12123801 [60,] 1432480 12108400 [61,] 1410830 12146301 [62,] 1447040 12110400 [63,] 1432480 12108401 [64,] 1411350 12129202 [65,] 1411350 12129203 [66,] 1447040 12110401 [67,] 1427600 12124500 [68,] 1407900 12113000 [69,] 1411200 12104602 [70,] 1436910 12136700 [71,] 1437240 12137801 [72,] 1399090 12126100 [73,] 1439300 12123800 [74,] 1431050 12153701 [75,] 1427600 12124501 [76,] 1468400 12095100 [77,] 1461320 12144200 [78,] 1399090 12126101 [79,] 1410830 12146301 [80,] 1459760 12047200 [81,] 1459760 12047201 [82,] 1459760 12047202 [83,] 1480320 12031700 [84,] 1477090 12029900 [85,] 1469420 12061300 [86,] 1468100 12069400 [87,] 1463578 12025986 [88,] 1486470 12056700 [89,] 1486470 12056701 [90,] 1475832 12054690 [91,] 1475864 12055208 [92,] 1459950 12026100 [93,] 1469420 12061301 [94,] 1480840 12056600 [95,] 1468620 12021000 [96,] 1459950 12026101 [97,] 1467330 12053900 [98,] 1469450 12046300 [99,] 1469020 12029500[100,] 1469020 12029501[101,] 1298060 12161000[102,] 1274250 12146100[103,] 1320480 12159600[104,] 1315350 12165100[105,] 1281280 12155100[106,] 1296740 12157600[107,] 1266680 12172900[108,] 1336180 12158500[109,] 1291430 12152600[110,] 1286870 12164500[111,] 1278650 12150800[112,] 1278990 12152200[113,] 1283450 12159000[114,] 1284180 12150000[115,] 1292120 12144100[116,] 1302840 12152300[117,] 1282470 12160300[118,] 1280813 12143228[119,] 1212660 12517338[120,] 1207823 12519046[121,] 1202968 12517038[122,] 1202113 12525129[123,] 1243157 12494427[124,] 1207363 12526526[125,] 1236696 12499338[126,] 1212576 12524585[127,] 1183104 12517301[128,] 1248668 12457722[129,] 1222785 12507983[130,] 1250901 12523857[131,] 1037579 12579038[132,] 1034475 12573747[133,] 1031892 12578378[134,] 1026728 12578284[135,] 1029287 12574751[136,] 1026712 12569199[137,] 1031170 12569280[138,] 1036705 12569110[139,] 1038039 12573816[140,] 959564 12587107[141,] 1240410 12519266[142,] 1281810 12296773[143,] 1232201 12518809[144,] 1188599 12314074[145,] 1164718 12328228[146,] 1231657 12527596[147,] 1240025 12528250[148,] 1218479 12504667[149,] 1205978 12523118[150,] 1246742 12469679[151,] 1259798 12584201[152,] 1193215 12521249[153,] 1206737 12537081[154,] 1053449 12362999[155,] 1003255 12572308[156,] 1002522 12573407[157,] 1003973 12572318[158,] 1061455 12643756
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20111128/5eb5e574/attachment.htm>
More information about the adegenet-forum
mailing list