функция адониса из веганской ошибки с именами столбцов - PullRequest
0 голосов
/ 29 мая 2020

У меня проблема с использованием функции adonis из веганского пакета в R:

Я вычисляю несходство Брея-Кертиса для OTU-таблицы с

dist <- vegdist(otu)

Моя таблица OTU - это матрица с 23 строками и 124 столбцами, содержащая значения счетчика.

У меня есть фактор с двумя уровнями под названием group, который выглядит так:

[1] CD  HFD HFD CD  CD  CD  CD  CD  CD  CD  HFD HFD HFD HFD HFD HFD HFD CD  CD  HFD CD  HFD CD 
Levels: CD HFD

Затем я хочу попробовать выполнить эту строку кода, которая не работает:

adonis <- adonis(dist ~ group)

Ошибка:

Error in `colnames<-`(`*tmp*`, value = colnames(lhs)) : 
  attempt to set 'colnames' on an object with less than two dimensions

Кто-нибудь может мне помочь Вот?

Edit: пакет и R-версии: R: 3.6.1 vegan: 2.6-5

Edit2: первые 5 строк OTU-таблицы: dput(otu[1:5,])

out <- structure(c(27.1250765149969, 1081.9093590775, 1256.04164676664, 
33.4137636354497, 856.238917982764, 31.2528055498878, 366.578171091445, 
253.278727672175, 1913.30116121249, 783.54500845326, 284.223627831055, 
59.6755162241888, 20.7039831884612, 223.000552958327, 610.152158673869, 
126.78024892879, 152.676320729418, 185.645715923202, 106.778766400241, 
92.9528679229722, 155.084676596613, 246.452131938858, 298.137357913841, 
140.192530035691, 108.445012576801, 850.901856763926, 51.1504424778761, 
46.929028560512, 1205.07464937415, 785.928415323079, 2237.22913691083, 
19.3751676052561, 17.2533193237176, 688.614085356658, 1272.73926848377, 
97.8861456845542, 265.052292839903, 554.866749450759, 0, 1.1917034349099, 
154.4950010202, 124.776079377849, 74.5343394784602, 259.319861257729, 
265.154014267453, 136.804733727811, 296.052561008313, 326.432801604738, 
418.398431609109, 377.174137148984, 45.4050193837992, 62.0005363368195, 
16.5631865507689, 165.616045845272, 120.3620469259, 38.3289124668435, 
24.8002145347278, 23.464514280256, 90.7982707485045, 68.5229475073193, 
289.530708018772, 167.401448109413, 36.5770369662814, 136.560599205751, 
183.522328976125, 95.5274433789023, 41.8503620273532, 35.8869041933327, 
127.117579047906, 86.3984990309678, 310.759028769639, 461.128989005095, 
274.672843633585, 396.606846629468, 256.812090223084, 3.53805345847786, 
6.20005363368195, 3.45066386474353, 11.6221786558086, 392.666281802812, 
38.3289124668435, 22.4751944220971, 3.45066386474353, 225.179711456291, 
411.733536761371, 43.6359926545603, 508.40439796192, 236.715541121406, 
97.3357462423968, 73.8856129644138, 79.0165272393389, 5.42504692947171, 
2.76053109179482, 43.5831699592822, 70.9063543771391, 24.766374209345, 
48.8254223652454, 75.2244722514089, 164.163273513296, 38.1345099171168, 
116.755764129769, 0, 5.52106218358965, 315.251596038808, 599.42682775968, 
137.984084880637, 558.004827031376, 334.024262107174, 246.244910269944, 
199.610325347408, 15.3315649867374, 14.7251273799946, 29.6757092367943, 
31.9609913034736, 48.8598408313059, 43.6359926545603, 115.475998927326, 
167.702263826535, 23.9707434776052, 25.6216238505629, 34.2011834319527, 
67.4255832662912, 45.5487630146146, 114.76901422611, 150.154632798647, 
391.544582738217, 1047.80906409225, 1091.79004680485, 458.349670738451, 
275.283493464187, 73.1197714752091, 336.352909627246, 411.319132677429, 
52.2998039511386, 72.098057812049, 145.060191797592, 27.9002413515688, 
2.07039831884612, 150.361936359523, 53.6266545709455, 40.0979391960824, 
275.127379994637, 262.250453720508, 16.7068818177248, 109.636716011711, 
60.1469087941236, 265.827299544114, 202.208902473971, 38.4984667973659, 
38.7303616345718, 142.111813915527, 142.601233574685, 267.771515904098, 
180.143769165033, 109.636716011711, 481.175270352989, 238.702064896755, 
129.054828541408, 722.754235158096, 785.332563605625, 316.066108957356, 
50.3754357736659, 102.829783169357, 208.472829638566, 140.621005319368, 
35.3805345847786, 303.802628050416, 428.572452001146, 39.951239129342, 
29.1967341552926, 21.8179963272801, 403.003486189327, 253.968860445124, 
217.189463630423, 190.076697868129, 243.536013058559, 4.65004022526146, 
62.8020823383322, 50.1206454531745, 56.6059131582203, 0, 0, 0.690132772948706, 
0, 139.429301884458, 16.5109161395634, 510.729418074551, 551.416085586016, 
119.853717388026, 260.387200527813, 146.239542950418, 61.2255296326093, 
69.0132772948706, 189.586789322877, 174.5845532143, 38.3289124668435, 
0, 0, 0, 23.834068698198, 58.9675576412977, 203.051756503084, 
271.91231254179, 40.67762529533, 75.6731681167787, 40.0979391960824, 
29.4502547599893, 44.8586302416659, 16.7068818177248, 15.4921446538287, 
63.6849622526015, 41.0753553231429, 29.6757092367943, 28.3290604735334, 
25.0257721331079, 269.48173842073, 577.379994636632, 657.006399847168, 
753.988840295581, 400.412354129727, 8.25545806978168, 67.4255832662912, 
54.5204890629478, 9.44302015784447, 35.1552513298421, 2106.91083452357, 
206.151783319925, 104.210048715255, 420.577590107073, 18.4714032411035, 
0.589675576412977, 349.52802359882, 322.292004967046, 0, 14.3004412189188, 
196.361966945521, 305.352641458836, 333.334129334225, 127.117579047906, 
106.657457424436, 21.2283207508672, 350.30303030303, 443.755373006018, 
262.951792087669, 13.1087377840089, 17.1005917159763, 156.551354250469, 
131.815359633203, 8.71663399185643, 13.7045895014639, 1806.76596612936, 
0.775006704210244, 0, 0.726386165988036, 2512.70669250753, 1.76902672923893, 
585.905068382944, 547.275288948324, 0, 28.0050307203827, 87.8616608855336, 
6.9750603378922, 4.83092941064094, 30.5082189714975, 7.74607232691435, 
74.2991226280351, 6.9750603378922, 9.66185882128188, 18.1596541497009, 
56.6059131582203, 128.549275658029, 36.4253150978815, 46.2388957875633, 
47.9414869552104, 16.0879963712837, 24.766374209345, 99.9758648431215, 
144.23774954628, 6.53747549389232, 4.17096202218465, 108.500306059988, 
48.8254223652454, 101.44951762346, 23.2443573116172, 8.34192404436931, 
34.7908590083656, 0, 5.52106218358965, 42.1303976273061, 16.0879963712837, 
0.589675576412977, 40.3003486189327, 11.732257140128, 9.44302015784447, 
11.3211826316441, 102.603550295858, 186.001609010459, 217.391823478842, 
64.6483687729352, 35.751103047297, 169.826566006937, 210.801823545186, 
200.828636928073, 312.346051374855, 166.242629169931, 70.7610691695572, 
24.0252078305176, 48.3092941064094, 51.5734177851506, 24.429920415653, 
112.038359518466, 0, 0, 61.016437942995, 44.6888788091213, 10.0244847990206, 
37.2003218020917, 30.3658420097431, 3.63193082994018, 5.36266545709455, 
4.71740461130382, 0, 0.690132772948706, 123.485648217966, 11.3211826316441, 
8.84513364619465, 103.075891659962, 71.0836756137167, 12.3485648217966, 
10.1294791967342, 12.9728626810855, 0, 0, 39.2248529633539, 15.4921446538287, 
47.1740461130382, 24.0252078305176, 8.97172604833317, 12.3485648217966, 
5.9585171745495, 204.02774943889, 5.42504692947171, 2.07039831884612, 
21.065198813653, 8.34192404436931, 13.5625382574985, 24.8002145347278, 
15.1829210048715, 12.3485648217966, 4.7668137396396, 0, 0, 0, 
65.3747549389232, 10.1294791967342, 26.535400938584, 12.4001072673639, 
7.59146050243576, 61.016437942995, 24.429920415653, 1.17935115282595, 
0, 0.690132772948706, 16.7068818177248, 37.5386581996619, 6.48643134054275, 
4.65004022526146, 5.52106218358965, 6.53747549389232, 7.74607232691435, 
63.6849622526015, 1.55001340842049, 11.0421243671793, 172.879907505153, 
8.34192404436931, 0, 279.777420219898, 156.660139459356, 2.90554466395214, 
50.6473959836708, 25.356049785758, 6.9750603378922, 12.4223899130767, 
6.53747549389232, 3.5751103047297, 2.35870230565191, 16.2751407884151, 
19.3237176425638, 4.35831699592822, 2.3834068698198, 0, 65.8755698578707, 
15.8730537778202, 2.17915849796411, 14.3004412189188, 4.71740461130382, 
0, 0, 0, 11.3211826316441, 0.589675576412977, 27.1252346473585, 
0, 0, 6.55436889200445, 7.07610691695572, 9.30008045052293, 13.1125226860254, 
6.53747549389232, 2.97925858727475, 0, 3.10002681684098, 10.3519915942306, 
0, 1.1917034349099, 25.945725362171, 22.4751944220971, 33.8165058744866, 
11.6221786558086, 26.2174755680178, 3.53805345847786, 0, 0, 0.726386165988036, 
21.4506618283782, 27.7147520914099, 1.55001340842049, 13.1125226860254, 
2.90554466395214, 1.1917034349099, 0, 0, 0, 0, 0, 0, 24.8002145347278, 
38.6474352851275, 0.726386165988036, 0, 321.962864721485, 97.6508447304907, 
36.5770369662814, 109.684311064193, 48.263989113851, 0.589675576412977, 
3.10002681684098, 2.07039831884612, 1261.73277032122, 3.5751103047297, 
50.122423995103, 1.55001340842049, 9.66185882128188, 0, 0, 6.48643134054275, 
10.0750871547332, 17.9434520966663, 5.81108932790429, 7.74607232691435, 
9.43480922260763, 144.151246983105, 64.8724806571783, 7.9902478258684, 
28.6008824378376, 0, 9.30008045052293, 10.3519915942306, 0, 0, 
0.589675576412977, 0, 0, 1.45277233197607, 0, 0.589675576412977, 
602.18020917136, 712.217021683064, 0, 2.97925858727475, 7.6657824933687, 
98.425851434701, 137.336421816792, 0, 0.59585171745495, 250.612119975515, 
63.55054974524, 122.153500811921, 199.75619564671, 0, 40.6876147724954, 
197.626709573612, 231.884611710765, 63.9219826069472, 39.3262133520267, 
0, 169.726468222043, 153.209475594613, 22.5179711456291, 0, 0, 
33.3252882810405, 54.5204890629478, 0, 0, 70.1713935931443, 70.5256100831322, 
107.660712579998, 0, 0.59585171745495, 0, 3.87503352105122, 84.1961982997421, 
0, 0, 0.589675576412977, 20.9251810136766, 35.196771420384, 0.726386165988036, 
19.6631066760134, 100.834523566619, 19.3751676052561, 37.2671697392301, 
65.3747549389232, 0, 0, 82.9257173504961, 55.2106218358965, 0, 
0, 0, 47.2754089568249, 33.1263731015379, 0, 1.1917034349099, 
0, 7.75006704210244, 31.0559747826918, 0, 0.59585171745495, 0, 
41.8503620273532, 37.9573025121788, 0, 0.59585171745495, 0, 6.20005363368195, 
23.464514280256, 0, 0, 0, 21.7001877178868, 9.66185882128188, 
22.5179711456291, 0, 0, 3.87503352105122, 12.4223899130767, 7.9902478258684, 
0, 17.6902672923893, 0.775006704210244, 4.14079663769223, 135.107826873775, 
0.59585171745495, 0, 3.87503352105122, 15.1829210048715, 0, 0, 
0, 3.10002681684098, 8.97172604833317, 0, 0, 0, 45.7253955484044, 
41.4079663769223, 0, 1.1917034349099, 0, 0, 0.690132772948706, 
0, 0, 0, 0, 0.690132772948706, 0, 13.7045895014639, 0, 0, 0.690132772948706, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0), .Dim = c(5L, 124L), .Dimnames = list(c("X1.CON.CD", 
"X10.CON.HFD", "X11.CON.HFD", "X12.CON.CD", "X13.SPF.CD"), c("OTU_1", 
"OTU_3", "OTU_12", "OTU_31", "OTU_16", "OTU_13", "OTU_2", "OTU_34", 
"OTU_46", "OTU_9", "OTU_19", "OTU_45", "OTU_28", "OTU_50", "OTU_6", 
"OTU_62", "OTU_25", "OTU_15", "OTU_59", "OTU_81", "OTU_48", "OTU_11", 
"OTU_49", "OTU_42", "OTU_30", "OTU_10", "OTU_22", "OTU_32", "OTU_286", 
"OTU_40", "OTU_82", "OTU_4", "OTU_18", "OTU_29", "OTU_20", "OTU_38", 
"OTU_423", "OTU_17", "OTU_26", "OTU_65", "OTU_47", "OTU_85", 
"OTU_53", "OTU_7", "OTU_41", "OTU_8", "OTU_143", "OTU_58", "OTU_382", 
"OTU_54", "OTU_5", "OTU_27", "OTU_67", "OTU_64", "OTU_51", "OTU_56", 
"OTU_37", "OTU_78", "OTU_76", "OTU_43", "OTU_14", "OTU_72", "OTU_77", 
"OTU_66", "OTU_96", "OTU_101", "OTU_69", "OTU_89", "OTU_79", 
"OTU_74", "OTU_136", "OTU_87", "OTU_70", "OTU_107", "OTU_73", 
"OTU_61", "OTU_86", "OTU_106", "OTU_94", "OTU_134", "OTU_83", 
"OTU_236", "OTU_206", "OTU_44", "OTU_115", "OTU_194", "OTU_52", 
"OTU_294", "OTU_24", "OTU_21", "OTU_103", "OTU_140", "OTU_57", 
"OTU_151", "OTU_97", "OTU_23", "OTU_247", "OTU_33", "OTU_36", 
"OTU_68", "OTU_397", "OTU_60", "OTU_112", "OTU_674", "OTU_63", 
"OTU_98", "OTU_84", "OTU_100", "OTU_95", "OTU_256", "OTU_114", 
"OTU_477", "OTU_99", "OTU_90", "OTU_111", "OTU_246", "OTU_39", 
"OTU_75", "OTU_123", "OTU_80", "OTU_35", "OTU_71", "OTU_364", 
"OTU_121")))
...