GetWeeklyAverages: Calculates the weekly averages of the metrics per geo.

Description Usage Arguments Value Note

View source: R/getweeklyaverages.R

Description

Calculates the weekly averages of the metrics per geo.

Usage

1
2
3
4
GetWeeklyAverages(obj, ...)

## S3 method for class 'GeoTimeseries'
GetWeeklyAverages(obj, na.rm = TRUE, ...)

Arguments

obj

an object.

...

further arguments passed to or from other methods.

na.rm

(flag) remove NAs?

Value

A data frame with one row per 'geo', and the weekly averages of each metric in the columns.

Note

Does not handle incomplete weeks. Each week is supposed to have the complete total sales of the week. If for example the first and last weeks of a daily data set are incomplete, the weekly average will be underestimated. Works for both weekly and daily data. The averages are calculated by first calculating the weekly sums for each geo, and then taking the averages over the weeks. NAs are removed by default.


google/GeoexperimentsResearch documentation built on May 17, 2019, 7:42 a.m.