【问题标题】:Include windspeed and pollution in pollutionrose在污染玫瑰中包括风速和污染
【发布时间】:2020-03-24 22:54:03
【问题描述】:

我想将风速和污染变量一起包含在一个污染玫瑰或风玫瑰中。 windrose()pollutionrose() 函数只能包含数据序列而不是风速。

图表应显示污染浓度颜色,风向方向和风速半径。如图所示。

pollutionRose(data, ws="ws", wd="wd", pollutant = "PM1", 
              breaks = c(0, 10, 20, 30, 40, 50, 60, 70))

windRose(data, ws = "ws", wd = "wd", pollutant = "PM1", 
         breaks = c(0, 10, 20, 30, 40, 50, 60, 70))

它应该是什么样子

【问题讨论】:

    标签: r openair


    【解决方案1】:

    您可以使用 openAir 中的极坐标图功能生成一个绘图,显示浓度随风速和风向的变化。我在下面为您提供了带有输出的代码示例,其中 Mock_Data 可以替换为您的输入文件。

    library(openair)
    library(truncnorm)
    
    #Mock data set providing three sites with 1,000 measurements of wind direction
    #wind speed and concentrations of a pollutant, in this case, PM10
    Site <- c(rep("Site_A",1000), rep("Site_B", 1000), rep("Site_C", 1000))
    ws <- rtruncnorm(n=3000, a=0, b=7, mean=2.5, sd=1.75)
    wd <- rtruncnorm(n=3000, a=0, b=359, mean=220, sd=50)
    PM10 <- rtruncnorm(n=3000, a=0.00, b=7.50, mean=2.5, sd=0.85)  
    Mock_Data <- data.frame(Site, ws, wd, PM10)     
    
    #Polar plot function
    polarPlot(Mock_Data,pollutant= "PM10",
          type = "Site", col = "jet",
          key.position= "right",key.header= "mean PM10 (ug/m3)", key.footer=NULL)
    

    给出这个输出—— 现在,在这里强调一下,使用这个模拟数据集并不是最好的复制现场实际发生的事情。在那里,盛行风向出现,风速因盛行风向而异,并且存在污染源,这意味着您可以指出您可能正在调查的污染物浓度较高的特定区域。尽管如此,这只是该功能的一个示例,并且在您自己的数据存在的情况下,应该复制您附加的图像。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-09
      • 2016-02-10
      相关资源
      最近更新 更多