compress.logs: Compress log files and optinally remove them

Description Usage Arguments Details Value

View source: R/compress.logs.R

Description

Compress log file and optinally remove them to save space and make simulations results more portable

Usage

1
2
3
compress.logs(path.results = NULL, scenarios = "all",
  delete.log = TRUE, overwrite.gz = TRUE, compression = 7,
  parallel = FALSE, ncores = NULL)

Arguments

path.results

The path to the 'Results' folder

scenarios

A character vector with the scenarios to be processed or "all"

delete.log

whether the log file should be deleted

overwrite.gz

if a .gz file with the same name is present, should it be overwritten?

compression

compression rate, integer between 0 and 9. See gzfile

parallel

whether execute the function in parallel

ncores

the number of cores if executed in parallel

Details

From (very limited) testing, a compression of 1 gives substantial compression (about 23% of original size) and it is very fast. compression=7 gives almost the max compression (~18.5% of the original size) taking ~ 4 times longer than compression=1. Anything beyon 7 takes much longer but with a gain of only a 0.1% or less.

Note that it makes sense to execute this function in parallel only if a solid state disk (SSD) is available

Value

a list where the first element is the list of log files found and the second is the gz files created


carlopacioni/HexSimR documentation built on Nov. 11, 2018, 8:33 p.m.