Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.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
plot.window(…)中出错:最终值';ylim';在R中使用boxcox规范化时需要_R - Fatal编程技术网

plot.window(…)中出错:最终值';ylim';在R中使用boxcox规范化时需要

plot.window(…)中出错:最终值';ylim';在R中使用boxcox规范化时需要,r,R,这里是数据示例 dt=structure(list(Latitude = c(28.11957, 28.11581, 28.11144, 28.1137, 28.02281, 28.06032, 28.10983, 28.11073, 28.13138, 28.04587), Longitude = c(77.40836, 77.41864, 77.38658, 77.38574, 77.26007, 77.27687, 77.45602, 77.

这里是数据示例

 dt=structure(list(Latitude = c(28.11957, 28.11581, 28.11144, 28.1137, 
    28.02281, 28.06032, 28.10983, 28.11073, 28.13138, 28.04587), 
        Longitude = c(77.40836, 77.41864, 77.38658, 77.38574, 77.26007, 
        77.27687, 77.45602, 77.45677, 77.41773, 77.38187), yield.x = c(4245L, 
        4592L, 3976L, 4005L, 3220L, 3397L, 4083L, 3840L, 4775L, 3324L
        ), ORYZA.Minimal = c(582.08, 310.27, 676.17, 565.53, 378.1, 
        800.02, 521.53, 667.02, 582.08, 815.03), ORYZA.Intensive = c(1391.7, 
        1275, 1413.9, 2742.1, 1595.9, 1945.4, 1945.4, 1945.4, 1637.9, 
        1637.9), IR36.Minimal = c(556.19, 252.01, 686.89, 489.67, 
        399, 717.98, 429.77, 588.65, 556.19, 773.37), IR36.Intensive = c(1582, 
        1479.4, 1552.1, 1421.1, 1601, 2073.8, 1464, 1533.7, 1582, 
        1824.6), WOFOST.Intensive = c(3131L, 3185L, 3131L, 3173L, 
        3140L, 3028L, 3155L, 3138L, 3131L, 3010L), IR72.Intensive = c(2937L, 
        3051L, 2937L, 3010L, 2965L, 2841L, 2969L, 2948L, 2937L, 2857L
        ), tmina1 = c(28.13171, 28.16585, 28.17805, 28.17805, 28.35366, 
        28.35122, 28.1561, 28.1561, 28.16098, 28.23902), tmaxa1 = c(34.37805, 
        34.39512, 34.41707, 34.41707, 34.5878, 34.56098, 34.43659, 
        34.43659, 34.38537, 34.49512), hmina1 = c(60.24634, 60.25366, 
        60.09024, 60.09024, 59.32683, 59.50732, 60.26098, 60.26098, 
        60.27317, 59.75854), rainss1 = c(6.05, 6.02, 6.12, 6.12, 
        8.62, 7.23, 5.28, 5.28, 6.07, 9.02), tmina2 = c(26.95854, 
        26.98537, 26.98049, 26.98049, 27.00976, 27.03659, 26.97805, 
        26.97805, 26.98293, 27), tmaxa2 = c(32.97561, 33.00488, 33.01463, 
        33.01463, 33.13902, 33.12439, 33.01951, 33.01951, 32.99756, 
        33.09268), hmina2 = c(63.60732, 63.63171, 63.43171, 63.43171, 
        62.86829, 63.00976, 63.76341, 63.76341, 63.65122, 63.20488
        ), rainss2 = c(27.94, 27.91, 29.49, 29.49, 32.2, 28.28, 25.71, 
        25.71, 27.53, 36.17), tmina3 = c(21.66429, 21.66429, 21.70238, 
        21.70238, 21.85952, 21.87381, 21.59048, 21.59048, 21.66905, 
        21.69524), tmaxa3 = c(33.64286, 33.66429, 33.67857, 33.67857, 
        33.97381, 33.88333, 33.70238, 33.70238, 33.65238, 33.80476
        ), hmina3 = c(30.24048, 30.27143, 29.99762, 29.99762, 28.57143, 
        28.93095, 30.3881, 30.3881, 30.30952, 29.44524), max_ndvi = c(0.883131206, 
        0.85527879, 0.858201087, 0.862457752, 0.876478314, 0.743324697, 
        0.88056463, 0.853658557, 0.790722787, 0.833333313), ndvi_av1 = c(0.813338554, 
        0.71207198, 0.733572155, 0.729932564, 0.876478314, 0.635059396, 
        0.689225515, 0.734376109, 0.656024903, 0.660404734), ndvi_av1_1 = c(0.7724209, 
        0.728266976, 0.78009241, 0.752792495, 0.772244539, 0.664578617, 
        0.789137627, 0.746921837, 0.639280979, 0.741114633), ndvi_sum_50 = c(136.6598759, 
        145.6536001, 146.1629442, 96.96318125, 28.6404264, 30.98428436, 
        51.02991654, 46.34770326, 103.7962121, 116.3206422), ndvi_sum_75 = c(43.98806781, 
        157.6088821, 99.82658933, 100.1613262, 23.16733616, 20.07433534, 
        32.67057598, 30.53274579, 28.02520227, 39.78411955), arvi_max = c(0.887292802, 
        0.859690845, 0.866099894, 0.879408419, 0.886393666, 0.770778656, 
        0.888767719, 0.869518697, 0.790722787, 0.820143878), lat1 = c(0.0926100000000005, 
        0.0963700000000003, 0.100739999999998, 0.0984799999999986, 
        0.18937, 0.151859999999999, 0.102350000000001, 0.10145, 0.0808, 
        0.166309999999999), lon1 = c(0.0484100000000041, 0.0381300000000095, 
        0.0701900000000109, 0.0710300000000075, 0.196700000000007, 
        0.179900000000004, 0.000750000000010687, 0, 0.03904, 0.0748999999999995
        )), row.names = c(NA, 10L), class = "data.frame")
我想使用boxcox变换将数据集中的所有变量规范化为正态分布。 我这么做很简单

library(MASS)
    bc <- boxcox(yield.x  ~ .,data=dt)
如何正确地规范化我的数据集,期望的输出将是这样的

  Latitude Longitude yield.x ORYZA.Minimal ORYZA.Intensive
1     0.15      0.13    0.08          0.17            0.17
2     0.10      0.02    0.10          0.20            0.04
3     0.04      0.10    0.10          0.20            0.12
4     0.01      0.08    0.12          0.14            0.08
5     0.07      0.02    0.08          0.11            0.08
6     0.07      0.11    0.19          0.15            0.02
7     0.12      0.08    0.20          0.13            0.14
  IR36.Minimal IR36.Intensive WOFOST.Intensive IR72.Intensive
1         0.13           0.09             0.15           0.08
2         0.02           0.08             0.14           0.02
3         0.19           0.14             0.02           0.19
4         0.17           0.13             0.05           0.17
5         0.12           0.15             0.18           0.15
6         0.09           0.06             0.15           0.10
7         0.13           0.04             0.11           0.01
  tmina1 tmaxa1 hmina1 rainss1 tmina2 tmaxa2 hmina2 rainss2 tmina3
1   0.20   0.08   0.19    0.20   0.02   0.19   0.10    0.12   0.01
2   0.15   0.19   0.01    0.20   0.08   0.10   0.14    0.04   0.11
3   0.08   0.04   0.05    0.09   0.18   0.08   0.09    0.19   0.15
4   0.12   0.13   0.12    0.13   0.13   0.19   0.06    0.04   0.13
5   0.19   0.09   0.03    0.18   0.04   0.07   0.14    0.14   0.08
6   0.19   0.15   0.19    0.18   0.15   0.10   0.18    0.02   0.01
7   0.10   0.15   0.17    0.11   0.19   0.10   0.18    0.08   0.19
  tmaxa3 hmina3 max_ndvi ndvi_av1 ndvi_av1_1 ndvi_sum_50
1   0.03   0.18     0.10     0.20       0.06        0.08
2   0.12   0.08     0.05     0.14       0.05        0.01
3   0.16   0.10     0.04     0.03       0.08        0.04
4   0.14   0.12     0.12     0.15       0.08        0.13
5   0.14   0.12     0.19     0.04       0.06        0.06
6   0.05   0.10     0.06     0.05       0.04        0.19
7   0.20   0.08     0.12     0.19       0.04        0.09
  ndvi_sum_75 arvi_max
1        0.09     0.03
2        0.10     0.05
3        0.11     0.08
4        0.01     0.08
5        0.19     0.14
6        0.09     0.19
7        0.14     0.03

使用
scale
可能有助于在整个dataframe/data.table上按列工作

scale(dt)

您是否需要缩放(dt)?我不知道这个命令。非常感谢。
scale(dt)