AggregateTimeSeriesData: AggregateTimeSeriesData

AggregateTimeSeriesDataR Documentation

AggregateTimeSeriesData

Description

This function will take raw data and aggregate it by date

Usage

AggregateTimeSeriesData(
  RAW_TS_DATA,
  DATE_COLUMN = "SalesDate",
  TARGET_COLUMN = "TotalSales",
  OTHER_VARIABLES_TO_AGG = NULL,
  BY_WHICH_GROUP = NULL,
  DEBUG = TRUE
)

Arguments

RAW_TS_DATA

The raw dataset that will be aggregated

DATE_COLUMN

The column name containing date value

TARGET_COLUMN

The column name containing target value

OTHER_VARIABLES_TO_AGG

Other columns that will be aggregated

BY_WHICH_GROUP

If value provided, aggregation will be done by this column

DEBUG

If TRUE, the function will run in debug mode

Value

returns a data table with the aggregated data by date and any potential group variables

Author(s)

Abraham Mathew

See Also

Other Data Preparation: AddDays(), AddMissingDates(), AddMonths(), AddWeeks(), CheckForMissingDates(), CreateOutputDates(), DoDataPartition(), FakeDataGenerator(), FlattenLongData(), RemoveSpecialChars()

Examples


## Not run: 

data <- GoodeR::FakeDataGenerator(NUM_ROWS = 10000,
                           DATE_COLS = 1,
                           NUMERIC_COLS = 3,
                           CHARACTER_COLS = 1,
                           LOGICAL_COLS = 0,
                           FACTOR_COLS = 2,
                           DEBUG = TRUE)
                           
AggregateTimeSeriesData(
             data,
             DATE_COLUMN = "date_ymd",
             TARGET_COLUMN = "V1",
             OTHER_VARIABLES_TO_AGG = NULL,
             BY_WHICH_GROUP = NULL,
             DEBUG = TRUE)
                           

## End(Not run)


abmathewks/GoodeR documentation built on June 12, 2025, 1:48 a.m.