Title: | Pre-Process of Time Series Data Set in R |
---|---|
Description: | Pre-process for discrete time series data set which is not continuous at the column of 'date'. Refilling records of missing 'date' and other columns to the hollow data set so that final data set is able to be dealt with time series analysis. |
Authors: | Will Kuan <[email protected]> |
Maintainer: | Will Kuan <[email protected]> |
License: | GPL(>= 3) |
Version: | 1.1.0 |
Built: | 2024-10-30 03:30:16 UTC |
Source: | https://github.com/aiien61/tigerhitter |
This data set is an example transaction data set which contains transactional details of a product in a couple of years
data.example
data.example
A data.frame containing 975 observations.
Take time series dataset and fields, then refill the missing date records and other fields.
dateRefill.fromData(data, dateCol.index, fixedCol.index, uninterpolatedCol.index, uninterpolatedCol.newValue)
dateRefill.fromData(data, dateCol.index, fixedCol.index, uninterpolatedCol.index, uninterpolatedCol.newValue)
data |
The data.frame dataset which is ready to be processed |
dateCol.index |
Date column |
fixedCol.index |
A row of column number which should be kept same values with the original |
uninterpolatedCol.index |
The column number which should be changed to different value into new record. |
uninterpolatedCol.newValue |
The value of a specific column which should be put into the new record. |
Real time series sales dataset could be not continuous in 'date' field. e.g., monthly sales data is continuous, but discrete in daily data.
This hollow dataset is not complete for time series analysis. Function dateRefill.fromFile is a transformation which tranforms uncomplete dataset into complete dataset.
The dataset which is completed.
Will Kuan
# mydata <- data.example # mydata.final <- dateRefill.fromData(data = mydata,dateCol = 2,fixedVec = c(3:10), # uninterpolatedCol.index = 11,uninterpolatedCol.newValue = 0)
# mydata <- data.example # mydata.final <- dateRefill.fromData(data = mydata,dateCol = 2,fixedVec = c(3:10), # uninterpolatedCol.index = 11,uninterpolatedCol.newValue = 0)
Take time series dataset and fields, then refill the missing date records and other fields.
dateRefill.fromFileToExcel(inPath, sheet, dateCol.index, outPath, fixedCol.index, uninterpolatedCol.index, uninterpolatedCol.newValue)
dateRefill.fromFileToExcel(inPath, sheet, dateCol.index, outPath, fixedCol.index, uninterpolatedCol.index, uninterpolatedCol.newValue)
inPath |
A path which is the location of uncompleted dataset which must be xlsx file |
sheet |
A worksheet name of the dataset |
dateCol.index |
Date column |
outPath |
A path where the location of xlsx file of completed dataset should be |
fixedCol.index |
A row of column number which should be kept same values with the original |
uninterpolatedCol.index |
The column number which should be changed to different value into new record. |
uninterpolatedCol.newValue |
The value of a specific column which should be put into the new record. |
Real time series sales dataset could be not continuous in 'date' field. e.g., monthly sales data is continuous, but discrete in daily data.
This hollow dataset is not complete for time series analysis. Function dateRefill.fromFile is a transformation which tranforms uncomplete dataset into complete dataset.
Will Kuan
# Please refer to the examples of function dateRefill.fromData
# Please refer to the examples of function dateRefill.fromData