我在尝试绘制污染玫瑰图时遇到了 R 问题,我几乎可以确定数据和代码是正确的,但我仍然不断收到错误消息,我无法弄清楚它是什么意思。错误信息是:
Error in `[[<-.data.frame`(`*tmp*`, vars[i], value = numeric(0)) :
replacement has 0 rows, data has 37.
我的代码是:
pollutionRose(pollution_rose, pollutant = "PM10",header= TRUE, cols = c("darkblue","green4","yellow2","red","red4"), key.position = "bottom",max.freq = 50)
这是我的数据:
HH:MM:SS WD1 WS1 PM10 PM2.5 PM1
10:10:00 AM 0 0 0 0 0
10:20:00 AM 0 0 0 0 0
10:29:00 AM 254 0.4 0 0 0
10:30:00 AM 109 0.5 0 0 0
10:40:00 AM 21 1.9 0 0 0
10:50:00 AM 148 1.2 0 0 0
10:54:00 AM 222 1.1 0 0 0
10:55:00 AM 61 1 0 0 0
11:00:00 AM 109 0.6 19 4.3 1.8
11:10:00 AM 354 0.7 20.4 4.1 1.7
11:20:00 AM 5 2.6 8.3 3.8 1.6
11:29:00 AM 60 2.6 7.9 3.8 1.5
11:30:00 AM 97 1.5 18.6 3.8 1.5
11:40:00 AM 42 0.8 15.6 3.8 1.5
11:50:00 AM 52 0 10.5 4.3 1.6
12:00:00 PM 60 0.9 11.7 3.9 1.5
12:10:00 PM 74 1 9.6 4.1 1.4
12:20:00 PM 338 1.7 0 0 0
12:30:00 PM 285 4.4 0 0 0
12:40:00 PM 296 3.6 0 0 0
12:50:00 PM 241 3.3 0 0 0
1:00:00 PM 274 1.2 0 0 0
1:10:00 PM 287 1.3 15.8 4.4 1.6
1:20:00 PM 317 3 13.1 4.6 1.7
1:30:00 PM 309 2.6 10.5 3.5 1.4
1:31:00 PM 244 3.5 14.8 4.2 1.5
1:40:00 PM 251 0.9 12.8 4.1 1.5
1:50:00 PM 282 1.1 12.9 4.8 1.8
2:00:00 PM 254 2.5 9.6 4.9 1.7
2:10:00 PM 245 2.3 10.9 4.6 1.6
2:20:00 PM 207 2.1 0 0 0
2:30:00 PM 30 0 0 0 0
2:37:00 PM 62 0.7 12.9 4.3 1.6
2:40:00 PM 80 1.8 10.1 3.6 1.5
2:40:00 PM 0 0 10.1 3.6 1.5
2:50:00 PM 0 0 10 4.3 1.5
3:00:00 PM 0 0 0 0 0