R/pat_aggregate_old.R
pat_aggregate_old.Rd
Calculates statistics associated with the aggregation of raw PurpleAir Timeseries data onto a regular time axis.
Temporal aggregation involves creating time period bins defined by
period
and then calculating the statistics associated with the raw
data measurements that fall within each bin. The result is a dataframe with
a regular time axis and multiple columns of output for every column of
input.
Each of the pat object data columns will result in the following basic statistics:
mean
median
sd
min
max
count
For the paired pm25_A
and pm25_B
data columns, the following
additional statistics are generated by applying a two-sample t-test to the
A and B channel data in each bin:
pm25_t
-- t-test statistic
pm25_p
-- p-value
pm25_df
-- degrees of freedom
These statistics are used to assign aggregate (hourly) values, (e.g.
temperature_mean
). They can also be used to invalidate some aggregate
values based on sd
, count
or pm25_t
.
pat_aggregate_old(pat = NULL, period = "1 hour")
pat | PurpleAir Timeseries pat object. |
---|---|
period | Time period to average to. Can be "sec", "min", "hour", "day", "DSTday", "week", "month", "quarter" or "year". A number can also precede these options followed by a space (i.e. "2 day" or "37 min"). |
Returns a dataframe with aggregation statistics.