diff --git a/tools/data_summary.R b/tools/data_summary.R index 34b6bd6e47d54477e1afc8cd846c4f3f7b54b0bd..4ff30875bb36132cb676d62603abfe7047b9cc19 100644 --- a/tools/data_summary.R +++ b/tools/data_summary.R @@ -19,14 +19,22 @@ data_summary <- function(data_cube, recipe) { # Create log instance and sink output to logfile and terminal info(recipe$Run$logger, "DATA SUMMARY:") - sink(recipe$Run$logfile, append = TRUE, split = TRUE) - print(paste0(object_name, " months: ", months)) - print(paste0(object_name, " range: ", sdate_min, " to ", sdate_max)) - print(paste0(object_name, " dimensions: ")) - print(dim(data_cube$data)) - print(paste0("Statistical summary of the data in ", object_name, ":")) - print(summary(data_cube$data)) - print("---------------------------------------------") - sink() + # sink(recipe$Run$logfile, append = TRUE, split = TRUE) + info(recipe$Run$logger, paste(object_name, "months:", months)) + info(recipe$Run$logger, paste(object_name, "range:", sdate_min, "to", + sdate_max)) + info(recipe$Run$logger, paste(object_name, "dimensions:")) + output_string <- capture.output(dim(data_cube$data)) + for (i in output_string) { + info(recipe$Run$logger, i) + } + info(recipe$Run$logger, paste0("Statistical summary of the data in ", + object_name, ":")) + output_string <- capture.output(summary(data_cube$data)) + for (i in output_string) { + info(recipe$Run$logger, i) + } + info(recipe$Run$logger, "---------------------------------------------") + # sink() }