diff --git a/DESCRIPTION b/DESCRIPTION index bdeadcd..2246102 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: iamrpt Title: Convert GCAM results to the format required by various IAM experiment databases -Version: 0.0.0.9000 +Version: 0.1.0 Authors@R: c( person("Robert", "Link", email = "robert.link@pnnl.gov", role = c("aut", "cre")), person("Xavier", "Gutierrez", email = "xavier.gutierrez@pnnl.gov", role = c("aut")) diff --git a/R/mcl.R b/R/mcl.R index 627330e..21872b0 100644 --- a/R/mcl.R +++ b/R/mcl.R @@ -137,8 +137,8 @@ generate <- function(scenctl, tabs = getOption('iamrpt.tabs', TRUE), outputdir = getwd()) { - scenctl <- readr::read_csv(scenctl) - varctl <- readr::read_csv(varctl) + suppressMessages({scenctl <- readr::read_csv(scenctl)}) + suppressMessages({varctl <- readr::read_csv(varctl)}) validatectl(scenctl, varctl) @@ -164,15 +164,15 @@ generate <- function(scenctl, if(fileformat == 'XLSX') { - output_xlsx(rslts, tabs, dbloc) + output_xlsx(rslts, tabs, outputdir) } else if(fileformat == 'CSV') { - output_csv(rslts, tabs, dbloc) + output_csv(rslts, tabs, outputdir) } else { warning('Unknown file format ', fileformat, ' requested. ', 'Writing as CSV.') - output_csv(rslts, tabs, dbloc) + output_csv(rslts, tabs, outputdir) } message('FIN.') diff --git a/R/output.R b/R/output.R index 0dfcded..5f9540d 100644 --- a/R/output.R +++ b/R/output.R @@ -33,13 +33,16 @@ output_csv <- function(rslts, tabs, dirname) if(tabs) { ## One file for each table for(tblname in names(rslts)) { - filename <- alternate_filename(file.path(dirname, paste0(tblname, '.csv'))) + filename <- alternate_filename(file.path(dirname, paste0(tblname, + '.csv'))) + message('Writing file ', filename) readr::write_csv(rslts[[tblname]], filename) } } else { ## Single file in PITA format. filename <- alternate_filename(file.path(dirname, 'iamrpt.csv')) + message('Writing file ', filename) fcon <- file(filename, 'w') line1 <- TRUE for(tblname in names(rslts)) {