View source: R/pre_processing_data.R
GeoDataRead | R Documentation |
GeoDataRead
reads a data-frame and processes it for GeoLift.
The function will clean the data, generate a time variable that
increases by 1 for each time period (day/week/month), and aggregate
the data by time and location. It is important to have data for each
location and time-period and avoid special characters in the names of
the geographical units.
GeoDataRead(
data,
date_id = "date",
location_id = "location",
Y_id = "units",
format = "mm/dd/yyyy",
X = c(),
summary = FALSE,
keep_unix_time = FALSE
)
data |
A data.frame containing the historical conversions by geographic unit. It requires a "locations" column with the geo name, a "Y" column with the outcome data (units), a time column with the date, and covariates. Valid date formats are: "mm/dd/yyyy", "mm-dd-yyyy", "mm.dd.yyyy", "mmddyyyy", "dd/mm/yyyy", "dd-mm-yyyy", "dd.mm.yyyy", "ddmmyyyy", "yyyy/mm/dd", "yyyy-mm-dd", "yyyy.mm.dd", "yyyymmdd", "ww/yyyy", "ww-yyyy", "ww.yyyy", "wwyyyy", "yyyy/ww", "yyyy-ww", "yyyy.ww", "yyyyww", "mm/yyyy", "mm-yyyy", "mm.yyyy", "mmyyyy", "yyyy/mm", "yyyy-mm", "yyyy.mm", "yyyymm" |
date_id |
Name of the date variable (String). |
location_id |
Name of the location variable (String). |
Y_id |
Name of the outcome variable (String). |
format |
Format of the dates in the data frame. |
X |
Vector with covariates names. |
summary |
Display a summary of the data-reading process. FALSE by default. |
keep_unix_time |
A logic flag indicating whether to keep a column with each event's unix time. |
A data frame for GeoLift inference and power calculations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.