用于成分分析的Compana函数在R中冻结

时间:2013-08-26 17:58:58

标签: r

我正在尝试使用R Studio对一组数据上的地面筑巢小鸡进行不同类型栖息地使用的成分分析。它开始处理但永不停止。我必须手动停止处理或杀死R Studio。 (R中的结果相同)

我正在使用adehabitatHS软件包中的campana函数。从adehabitat我能够毫无问题地运行样本野鸡和松鼠数据。 (我试过从两个包中调用campana得到相同的结果。)

对于每只小鸡,可用的栖息地因其作为巢穴周围的缓冲区而变化。

我的数据 这是每只小鸡的可用栖息地:

grass fallow.plot oil.seed.rape spring.barley winter.wheat maize other.crops other woodland hedgerow
1  23.35        7.53         45.75          0.00         0.00  0.00        0.00  0.00    23.37     0.00
2  86.52       10.35          0.00          0.00         1.24  0.00        0.00  1.89     0.00     0.00
3   5.18       10.33         28.36         38.82         0.00  0.00       17.17  0.14     0.00     0.00
4   4.26       18.32         27.31         32.66         3.82  0.00        0.00  5.02     5.52     3.09
5   4.26       18.32         27.31         32.66         3.82  0.00        0.00  5.02     5.52     3.09
6  12.52       10.35          0.00          0.00         0.00 18.02       43.59 13.15     2.37     0.00
7  21.41       11.56         59.25          0.00         0.00  0.00        0.00  5.82     0.00     1.96
8  21.41       11.56         59.25          0.00         0.00  0.00        0.00  5.82     0.00     1.96
9  36.17       16.93          0.00         30.14         0.00  0.00        0.00  7.08     9.68     0.00
10  0.00       12.17         26.49          0.00         3.99 55.77        0.00  1.58     0.00     0.00
11  0.00       10.27         67.41          1.93        18.30  0.00        0.00  1.18     0.00     0.91
12  2.66        5.38          0.00         14.39        54.06  0.00        8.40  3.83     7.84     3.44
13  2.66        5.38          0.00         14.39        54.06  0.00        8.40  3.83     7.84     3.44
14 84.22        8.00          0.00          0.00         0.00  2.90        0.00  0.22     3.84     0.82
15 84.22        8.00          0.00          0.00         0.00  2.90        0.00  0.22     3.84     0.82
16 86.85       13.04          0.00          0.00         0.00  0.00        0.00  0.11     0.00     0.00
17 86.85       13.04          0.00          0.00         0.00  0.00        0.00  0.11     0.00     0.00
18 86.85       13.04          0.00          0.00         0.00  0.00        0.00  0.11     0.00     0.00
19 86.85       13.04          0.00          0.00         0.00  0.00        0.00  0.11     0.00     0.00
20 21.41        8.11          0.47          8.08         0.00  0.00       56.78  2.26     0.00     2.89

这是使用过的栖息地(mcp):

grass fallow.plot oil.seed.rape spring.barley winter.wheat maize other.crops  other woodland hedgerow
1  41.14       58.67          0.19          0.00         0.00  0.00        0.00   0.00        0      0.0
2  35.45       64.55          0.00          0.00         0.00  0.00        0.00   0.00        0      0.0
3  10.10       60.04          7.72         21.37         0.00  0.00        0.00   0.77        0      0.0
4   0.00       44.55          0.00         50.27         0.00  0.00        0.00   5.18        0      0.0
5   2.82       48.48         44.80          0.00         0.00  0.00        0.00   0.00        0      3.9
6   0.00        0.00          0.00          0.00         0.00  0.00        0.00 100.00        0      0.0
7   0.00       87.41         12.59          0.00         0.00  0.00        0.00   0.00        0      0.0
8   0.00       83.59         16.41          0.00         0.00  0.00        0.00   0.00        0      0.0
9   0.00      100.00          0.00          0.00         0.00  0.00        0.00   0.00        0      0.0
10  0.00       18.93          0.00          0.00         0.00 81.07        0.00   0.00        0      0.0
11  0.00      100.00          0.00          0.00         0.00  0.00        0.00   0.00        0      0.0
12  0.00       22.79          0.00          0.00        77.13  0.00        0.00   0.08        0      0.0
13  0.00        0.00          0.00          0.00       100.00  0.00        0.00   0.00        0      0.0
14 54.60       44.97          0.00          0.00         0.00  0.00        0.00   0.43        0      0.0
15 62.86       36.57          0.00          0.00         0.00  0.00        0.00   0.57        0      0.0
16 11.15       88.10          0.00          0.00         0.00  0.00        0.00   0.75        0      0.0
17 20.06       79.62          0.00          0.00         0.00  0.00        0.00   0.32        0      0.0
18 38.64       60.95          0.00          0.00         0.00  0.00        0.00   0.41        0      0.0
19  3.81       95.81          0.00          0.00         0.00  0.00        0.00   0.38        0      0.0
20  0.00        3.56          0.00          0.00         0.00  0.00       96.44   0.00        0      0.0

我尝试了相同结果的参数和随机化测试。我正在运行的代码:

habuse <- compana(used, avail, test = "randomisation",rnv = 0.001, nrep = 500, alpha = 0.1)
habuse <- compana(used, avail, test = "parametric")

我出错的任何想法?

1 个答案:

答案 0 :(得分:0)

我发现了自己问题的答案。对于使用的数据,该函数用您指定的值替换0值(在我的情况下为0.001)。但它并没有取代可用数据中的0值,也不喜欢它们。

我在可用表中用0.001替换了所有0,调整了其他值并且功能正常工作。