Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
数据[[grp[i]]中出错:下标超出范围_R_Statistics - Fatal编程技术网

数据[[grp[i]]中出错:下标超出范围

数据[[grp[i]]中出错:下标超出范围,r,statistics,R,Statistics,我试图使用packageWRS2中的bwtrim函数进行方差分析,但它返回以下错误 bwtrim(formula = Sumarea ~ Snumber * Day, id = id, data = CO2) 数据[[grp[i]]中出错:下标超出范围 据我从本网站的其他问题(如“[中的错误)中了解,解决方案是删除我的中间因子中未使用的因子水平。这些都是由于子集 因此,请您使用以下工具检查您的数据: str(数据) 对于可以通过比较来检查是否有未使用的级别的因素: n级别(数据$factorc

我试图使用package
WRS2
中的
bwtrim
函数进行方差分析,但它返回以下错误

bwtrim(formula = Sumarea ~ Snumber * Day, id = id, data = CO2)
数据[[grp[i]]中出错:下标超出范围


据我从本网站的其他问题(如“[中的错误)中了解,解决方案是删除我的中间因子中未使用的因子水平。这些都是由于子集

因此,请您使用以下工具检查您的数据:

str(数据)

对于可以通过比较来检查是否有未使用的级别的因素:

n级别(数据$factorcolumn)

长度(唯一(数据$factorcolumn))

如果它们不同,您可以使用


data$factorcolumn请在帮助文件中为您指定用于此函数运行的DDO示例的包?如果是,则您的数据可能特别不同。可能您有一个只有一个值的列…@akrun I仅使用WRS2包
> head(CO2)
    Sname Snumber Day Replica Diff Area Sumarea id
1 H4.8AxB       1   0       1    0    0       0  1
2 H4.8AxB       1   0       2    0    0       0  2
3 H4.8AxB       1   0       3    0    0       0  3
4 H4.8AxB       1   0       4    0    0       0  4
5    S141       2   0       1    0    0       0  5
6    S141       2   0       2    0    0       0  6
> tail(CO2)
       Sname Snumber Day Replica Diff  Area Sumarea  id
511 II-1Q61L      14  28       3  400 12530   34505 511
512 II-1Q61L      14  28       4    0     0   40348 512
513    Straw      15  28       1   20   140     790 513
514    Straw      15  28       2  120   875    7435 514
515    Straw      15  28       3  130   700    7925 515
516    Straw      15  28       4  130  1050    8935 516
sppbb(formula = Sumarea ~ Snumber * Day, id, CO2, est = "onestep", nboot = 500)
c1 <- subset(CO2, subset = Snumber == "1")
 Sname Snumber Day Replica Diff Area Sumarea  id
1   H4.8AxB       1   0       1    0    0       0   1
2   H4.8AxB       1   0       2    0    0       0   2
3   H4.8AxB       1   0       3    0    0       0   3
4   H4.8AxB       1   0       4    0    0       0   4
61  H4.8AxB       1   3       1 1210 1815    1815  61
62  H4.8AxB       1   3       2 2150 3225    3225  62
63  H4.8AxB       1   3       3 1600 2400    2400  63
64  H4.8AxB       1   3       4 1910 2865    2865  64
117 H4.8AxB       1   4       1 6280 3745    5560 117
118 H4.8AxB       1   4       2 6990 4570    7795 118
119 H4.8AxB       1   4       3 6440 4020    6420 119
120 H4.8AxB       1   4       4 6150 4030    6895 120
177 H4.8AxB       1   5       1 3820 5050   10610 177
178 H4.8AxB       1   5       2 5420 6205   14000 178
179 H4.8AxB       1   5       3 4780 5610   12030 179
180 H4.8AxB       1   5       4 5310 5730   12625 180
237 H4.8AxB       1   6       1 2320 3070   13680 237
238 H4.8AxB       1   6       2 2700 4060   18060 238
239 H4.8AxB       1   6       3 1900 3340   15370 239
240 H4.8AxB       1   6       4 2520 3915   16540 240
297 H4.8AxB       1   7       1 1240 1780   15460 297
298 H4.8AxB       1   7       2 1870 2285   20345 298
299 H4.8AxB       1   7       3 1350 1625   16995 299
300 H4.8AxB       1   7       4 1480 2000   18540 300
361 H4.8AxB       1  10       1  460 2550   18010 361
362 H4.8AxB       1  10       2  910 4170   24515 362
363 H4.8AxB       1  10       3  810 3240   20235 363
364 H4.8AxB       1  10       4  770 3375   21915 364
425 H4.8AxB       1  14       1    0    0   27975 425
426 H4.8AxB       1  14       2  820 3460   27975 426
427 H4.8AxB       1  14       3  580 2780   23015 427
428 H4.8AxB       1  14       4  530 2600   24515 428