Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.04 KB

README.md

File metadata and controls

40 lines (31 loc) · 1.04 KB

timemerge

binning function for time series

CAUTION! REQURIES DPLYR 0.7.0

Install using:

devtools::install_github("rosseji/timemerge")

Example call:

df_binned <- binner(df = df_coff,
                    date_var = Item.Time.Created.date,
                    cat_var = Item.Name,
                    val_var = Prices,
                    interval = "hour")
                    
ggplot(df_binned, aes(x = bin_id, y = Total, colour = Item.Name)) + 
  geom_line()
  

Has a new argument method to specify the math:

df_binned <- binner(df = df_coff,
                    date_var = Item.Time.Created.date,
                    cat_var = Item.Name,
                    val_var = Prices,
                    interval = "hour",
                    method = "avg")

Weekly binning Weekly binning

Daily binning Daily binning