从使用 R 露天时间变化函数生成的日图中提取绘图数据点

问题描述 投票:0回答:1

*我使用了以下代码并从标题中提取了“小时”子图的数据。不过,我现在已经忘记怎么做了。我不确定底部是否缺少任何代码。请修改以下内容并让我知道如何获取 CSV 或文本格式的数据。 *

**

library(readxl)
library(tidyverse)
library(openair)
library(dplyr)

Georgia <- read_excel("C:/Users/TT/Desktop/FT/AA/Daily Average/Georgia.xlsx", 
                   sheet = "Refined Data", col_types = c("text", 
                                                         "text", "date", "numeric", "numeric", 
                                                         "numeric", "numeric", "numeric", 
                                                         "numeric", "text", "numeric", "text", 
                                                         "text", "text"))

tail(timeVariation(selectByDate(Georgia, year = 2017), pollutant = "pm2.5", group = "month"), subset ="hour")

**

The tibble I need to extract :

r subset subplot openair
1个回答
0
投票

openair
包附带测试数据。这是有关如何提取小时图数据的示例。

这里我们创建一个

tv
对象,它是使用示例数据的
timeVariation
函数的结果:

library(openair)

tv <- timeVariation(mydata, pollutant = "nox")

要访问绘制的数据(包括平均值和置信区间),您可以使用:

tv$data$hour

或者,要存储在 .csv 文件中,请尝试(包括感兴趣的文件名):

write.csv(tv$data$hour, "openair_mydata.csv")
© www.soinside.com 2019 - 2024. All rights reserved.