2017-05-02 10 views
2

Rでadonisを使用してPERMANOVAを実行しようとしましたが、私のデータテーブルおよび要因に追加されましたが、サンプルエラーが発生しました。ハット):適合しない配列G * t(帽子)のエラー:不適合アレイ

N/Aデータはありません。データの準備済みマトリックスと自分のデータテーブルのサブセットで動作します。

サンプルデータは機能しません。 Gの* tの(ハット)で

subset<-matrix(c(0,0.000666667,0.001333333,0.000333333,0.000333333,0.019833333,0.007666667,0.014666667,0.0005,0.022833333,0.016833333,0.018166667,0.000666667,0.009666667,0.008833333,0.009166667,0.001333333,0.018666667,0.0295,0.031833333),ncol=4) 

test_groups<-c(1,1,2,2) 
adonis(subset~test_groups) 

エラー:作業を行う非適合アレイ

試験データ。

test<-matrix(data=c(0.1,0.1,0.3,0.1,0.2,0.3,0.1,0,0.3,0.1,0.2,0.3,0.1,0.2,0.3,0.1),ncol=4) 

なぜ機能しませんか? I 5にsubsetの行数を設定し、adonisコマンドがうまく動作の下subsetの行数が5
している間

答えて

0

test_groupsベクトルの長さは4です。

library(vegan) 
subset <- matrix(c(0,0.000666667,0.001333333,0.000333333,0.000333333,0.019833333,0.007666667,0.014666667,0.0005,0.022833333,0.016833333,0.018166667,0.000666667,0.009666667,0.008833333,0.009166667,0.001333333,0.018666667,0.0295,0.031833333),ncol=5) 
test_groups <- c(1,1,2,2)  
adonis(subset~test_groups) 

結果は次のとおりです。

'nperm' >= set of all permutations: complete enumeration. 
Set of permutations < 'minperm'. Generating entire set. 

Call: 
adonis(formula = subset ~ test_groups) 

Permutation: free 
Number of permutations: 23 

Terms added sequentially (first to last) 

      Df SumsOfSqs MeanSqs F.Model  R2 Pr(>F) 
test_groups 1 0.22804 0.22804 1.0592 0.34624 0.3333 
Residuals 2 0.43059 0.21530   0.65376  
Total  3 0.65864     1.00000 
+0

ありがとうございました。行と列を入れ替えていただきありがとうございます。 – Bex

関連する問題