1

Originally, I have some missing data in ws (wind speed) and wd (wind speed),

    timestamp   no  pm  hum 
1   1404227061  49  2.5 54  
2   1404227121  35  4.5 52  
3   1404227181  27  6.6 49  
4   1404227241  8   7.1 48  
5   1404227301  51  8.4 46  
6   1404227361  20  9.0 44  

So I have to fill in the gap with daily summary data,

dat <- transform(dat, wd = 230, ws = 2.160000 )

    timestamp   no  pm  hum wd  ws
1   1404227061  49  2.5 54  230 2.16
2   1404227121  35  4.5 52  230 2.16
3   1404227181  27  6.6 49  230 2.16
4   1404227241  8   7.1 48  230 2.16
5   1404227301  51  8.4 46  230 2.16
6   1404227361  20  9.0 44  230 2.16

Then, I run this function in openair package,

polarPlot(dat, pollutant = "pm", na.rm = TRUE)

result,

Error in cut.default(mydata[[x]], breaks = seq(0, max.ws, length = 31),  : 
  'breaks' are not unique

What does it mean? What can I do to fix this? Or is it something incorrect with my data?

EDIT:

changed the value of a ws,

dat[4, "ws"] = 5.6

result,

Warning message:
Not enough data to fit surface.
Try reducing the value of the smoothing parameter, k to less than 100. 
Run
  • 54,938
  • 169
  • 450
  • 748
  • I get a different error when I run your code: `Error in gam(binned^n ~ s(u, v, k = k)) : Not enough (non-NA) data to do anything meaningful` – Tim Biegeleisen Apr 30 '15 at 14:09
  • The `polarPlot` function calls the `cut` function. `cut` is throwing an error because it's trying to create a `breaks` vector that has a repeated value, but `cut` needs unique values for the breaks. My guess is that this is occurring because all of your `ws` values are the same. Do you still get the error if you change one of the `ws` values to some other number? – eipi10 Apr 30 '15 at 14:35
  • I changed one of the `ws` values to some other number, I get a new error, please see my edit above. – Run Apr 30 '15 at 14:58

0 Answers0