11.07.2015 Views

Package 'openair'

Package 'openair'

Package 'openair'

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

122 timeAverageTheilSen(mydata, pollutant = "nox")# trend plot for ozone with p=0.01 i.e. uncertainty in slope shown at# 99 % confidence interval## Not run: TheilSen(mydata, pollutant = "o3", ylab = "o3 (ppb)", alpha = 0.01)# trend plot by each of 8 wind sectors## Not run: TheilSen(mydata, pollutant = "o3", type = "wd", ylab = "o3 (ppb)")# and for a subset of data (from year 2000 onwards)## Not run: TheilSen(select.by.date(mydata, year = 2000:2005), pollutant = "o3", ylab = "o3 (ppb)")timeAverageFunction to calculate timeAverages for data framesDescriptionFunction to flexibly aggregate or expand data frames by different time periods, calculating vectoraveragedwind direction where appropriate. The averaged periods can also take account of datacapture rates.UsagetimeAverage(mydata, avg.time = "day", data.thresh = 0,statistic = "mean", percentile = NA, start.date = NA,vector.ws = FALSE)Argumentsmydataavg.timeA data frame containing a date field . Can be class POSIXct or Date.This defines the time period to average to. Can be “sec”, “min”, “hour”, “day”,“DSTday”, “week”, “month”, “quarter” or “year”. For much increased flexibilitya number can precede these options followed by a space. For example,a timeAverage of 2 months would be period = "2 month". In addition,avg.time can equal “season”, in which case 3-month seasonal values are calculatedwith spring defined as March, April, May and so on.Note that avg.time can be less than the time interval of the original series,in which case the series is expanded to the new time interval. This is useful,for example, for calculating a 15-minute time series from an hourly one wherean hourly value is repeated for each new 15-minute period. Note that whenexpanding data in this way it is necessary to ensure that the time interval of theoriginal series is an exact multiple of avg.time e.g. hour to 10 minutes, dayto hour. Also, the input time series must have consistent time gaps betweensuccessive intervals so that timeAverage can work out how much ‘padding’ toapply.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!