Output_file-class: Output files saved in the data preparation program

Description Fields Methods

Description

Output files saved in the data preparation program

Fields

file

: name of the file that is going to be saved (R.data, csv, xlsx)

data

: data that is going to be saved

data_name

: name of the variable that contains the data (string)

path

: path of file (NULL if omitted)

version

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

process

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

Methods

f_save(...)

function save()

By default : save( data, paste0(path, version, file), ... )

Example

save( MasterData, file = paste0( PathLoad, Version, 'SalesnFcst.Rdata' ) ) is now replaced by

Output_file(data = MasterData, data_name = 'MasterData', file = 'SalesnFcst.Rdata', path = PathLoad, version = Version, process = 'SalesnFcst')$f_save()

f_write.csv(...)

function write.csv()

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

Example

write.csv(FutFcst,paste0(PathLoad,'Future_Fcst.csv'), row.names = FALSE, na = '') is now replaced by

Output_file(data = FutFcst, file = 'Future_Fcst.csv', path = PathLoad, process = 'Forecast')$f_write.csv(row.names = FALSE, na = '')

f_write.xlsx(...)

function write.xlsx() from openxlsx package

By default : write.xlsx(data, paste0( path, version, file ), ... )

Example

write.xlsx(FutFcst, paste0(PathLoad,'Future_Fcst.xlsx') ) is now replaced by

Output_file(data = FutFcst, file = 'Future_Fcst.xlsx', path = PathLoad, process = 'Forecast')$f_write.xlsx()


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