Input_file-class: Inputs loaded in the data preparation program from files

Description Fields Methods

Description

Inputs loaded in the data preparation program from files

Fields

file

: name of the file loaded (R.data, csv, xlsx)

path

: path of file (NULL if omitted)

version

: version in path ( DEV/ for Development, blank for production) (NULL if omitted)

process

: process where input is loaded in the data preparation program (to be added by user)

Methods

f_load(...)

function load()

By defaut : load( paste0( path, version, file ), envir = .GlobalEnv, ...)

Example

load( 'SalesnFcst.Rdata' ) is now replaced by

Input_file( file = 'SalesnFcst.Rdata', process = 'SalesnFcst' )$f_load() (version and path = NULL)

f_read.csv(...)

function read.csv()

By default : read.csv( paste0( path, version, file ), ... )

Example

read.csv( 'Dependencies_Map/dependencies.csv' ) is now replaced by

Input_file( file = 'dependencies.csv', path = 'Dependencies_Map/', process = 'SalesnFcst')$f_read.csv() (version = NULL)

f_read.xls(...)

function read.xls() from gdata package

By default : gdata::read.xls( paste0( path, version, file ), ... )

f_read.xlsx(...)

function read.xlsx() from openxlsx package

By default : openxlsx::read.xlsx( paste0( path, version, file ), ... )

Example

read.xlsx( paste0( PathLoad, Version, 'Baselines_and_forecastable.xlsx' ), sheet = 'SkuMatrix', colNames = TRUE ) is now replaced by

Input_file( file = 'Baselines_and_forecastable.xlsx', path = PathLoad, version = Version, process = 'SalesnFcst' )$f_read.xlsx( sheet = 'SkuMatrix', colNames = TRUE )


Pablo-Lopez-Sfi/dependenciesMap documentation built on June 30, 2020, 2:53 p.m.