【发布时间】:2016-10-04 20:02:28
【问题描述】:
我正在使用 R 的 openair 包来绘制超过一百个 .csv 文件的时间序列。我可以生成情节,但无法为情节添加标题。此外,我希望标题是可以从文件名或 .csv 文件的第一列中提取的站点位置。看起来你可以使用 timeplot 函数的 auto.text 来做到这一点,但我没有任何运气。是否可以在时尚中添加标题?如果可以,怎么做?
library(openair)
filedir <- "C:/Users/dfmcg/Documents/Thesis files/ALL_GPMP_O3_Met"
myfiles <- c(list.files(path = filedir))
paste(filedir, myfiles,sep = '/')
npsfiles <- c(paste(filedir, myfiles,sep = '/'))
for (i in npsfiles[1:3]){
timeozone <- import(i, date="DATE", date.format = "%m/%d/%Y %H", header = TRUE,
na.strings = "-999", auto.text(main = ("ABBR")))
timePlot(timeozone, pollutant = c("O3"))
}
这里是一小部分数据:
ABBR DATE O3 SWS VWS SWD VWD
ZION-DW 01/01/2004 00 -999 -999 -999 -999 -999
ZION-DW 01/01/2004 01 -999 -999 -999 -999 -999
【问题讨论】: