Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pat_timeAverage() #42

Closed
jonathancallahan opened this issue Apr 20, 2019 · 0 comments
Closed

pat_timeAverage() #42

jonathancallahan opened this issue Apr 20, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jonathancallahan
Copy link
Member

jonathancallahan commented Apr 20, 2019

This function should limit its functionality to wrapping potentially multiple calls to the openair::timeAverage() function and returning a data frame. We will keep the A and B channels separate for now.

We still need to do some investigating of the "pat" data so we can come up with some sort of reasonable QC before we start mixing A and B together to create our "official" number.

Input

  • pat = NULL -- pa_timeseries object
  • parameter = "pm25_A" -- "pat" data column to process
  • period = "10 min" -- used as avg.time ("period" is the terminology preferred by lubridate)
  • dataThreshold = 0 -- used as data.thresh
  • stats = "all" -- vector of statistics to return as dataframe columns
  • fill = FALSE" -- used as fill

Omit all of the following from opener::timeAverage(): "type, "percentile", "start.date", "end.date", "interval" and "vector.ws".

Output
The returned dataframe should have a first column named datetime followed by the names of the requested statistics with "count" replacing openair's "frequency".

When it all works, a user should be able to do the following:

# Generate a plot of 10 minute averages for pm25_A
pat %>%
  pat_timeAverage("pm25_A", "10 min", stats = "mean") %>%
  plot()
# Generate a QC plot of all statistics for channel B
pat %>%
  pat_timeAverage("pm25_B", "1 hour") %>%
  timeAveragePlot(plottype = "QC")
# Test my own ideas for a QC metric
my_qc <- 
  pat_timeAverage("pm25_A", "1 hour", stats = c("median", "sd", "count")) %>%
  mutate(qc_1 = median - sd, qc_2 = median / sd, qc_3 = sd * count)

somePlotFunction(my_qc)
@jonathancallahan jonathancallahan added this to To do in AirSensor 0.2 via automation Apr 20, 2019
@jonathancallahan jonathancallahan added the enhancement New feature or request label Apr 20, 2019
hmrtn added a commit that referenced this issue Apr 20, 2019
@hmrtn hmrtn closed this as completed Apr 20, 2019
AirSensor 0.2 automation moved this from To do to Done Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
AirSensor 0.2
  
Done
Development

No branches or pull requests

2 participants