diff --git a/R/ds.table.R b/R/ds.table.R index e1238e2a..0f6ea996 100644 --- a/R/ds.table.R +++ b/R/ds.table.R @@ -1539,6 +1539,12 @@ if(num.table.dims==1) }#END second dim=1 loop +################################################# +# Setup on.exit() to restore options 'warn' value +################################################# + +old_warn_option <- base::getOption("warn") +on.exit(base::options(warn = old_warn_option), add = TRUE) ################################ #NOW UNDERTAKE CHISQUARED TESTS# diff --git a/R/ds.table2D.R b/R/ds.table2D.R index 1402e542..d632755a 100644 --- a/R/ds.table2D.R +++ b/R/ds.table2D.R @@ -112,6 +112,13 @@ ds.table2D <- function(x=NULL, y=NULL, type='both', warningMessage=TRUE, datasou stop("Function argument 'type' has to be either 'combine', 'split' or 'both'") } + ################################################# + # Setup on.exit() to restore options 'warn' value + ################################################# + + old_warn_option <- base::getOption("warn") + on.exit(base::options(warn = old_warn_option), add = TRUE) + # the input variable might be given as column table (i.e. D$x) # or just as a vector not attached to a table (i.e. x) # we have to make sure the function deals with each case diff --git a/R/glmChecks.R b/R/glmChecks.R index 6dcfe2ee..b469c7c7 100644 --- a/R/glmChecks.R +++ b/R/glmChecks.R @@ -52,6 +52,14 @@ glmChecks <- function(formula, data, offset, weights, datasources){ varIdentifier <- append(varIdentifier, "weights") } + ################################################# + # Setup on.exit() to restore options 'warn' value + ################################################# + + old_warn_option <- base::getOption("warn") + on.exit(base::options(warn = old_warn_option), add = TRUE) + + # check that each variable is defined and not empty and each study. Stop the process if any check fails stdnames <- names(datasources) for(i in 1:length(elts)){ diff --git a/tests/testthat/perf_files/default_perf_profile.csv b/tests/testthat/perf_files/default_perf_profile.csv index ece226df..58614204 100644 --- a/tests/testthat/perf_files/default_perf_profile.csv +++ b/tests/testthat/perf_files/default_perf_profile.csv @@ -6,9 +6,9 @@ "ds.asNumeric::perf:0","2.185","0.5","2" "ds.assign::perf::0","5.490","0.5","2" "ds.class::perf::combine:0","4.760","0.5","2" -"ds.colnames::perf:0","4.159","0.5","2" +"ds.colnames::perf:0","9.079","0.5","2" "ds.exists::perf::combine:0","11.09","0.5","2" "ds.length::perf::combine:0","9.479","0.5","2" "ds.mean::perf::combine:0","9.650","0.5","2" "ds.mean::perf::split:0","11.26","0.5","2" -"void::perf::void::0","46250.0","0.5","2" \ No newline at end of file +"void::perf::void::0","46250.0","0.5","2" diff --git a/tests/testthat/perf_files/opal_azure-pipeline.csv b/tests/testthat/perf_files/opal_azure-pipeline.csv index d75711a3..58614204 100644 --- a/tests/testthat/perf_files/opal_azure-pipeline.csv +++ b/tests/testthat/perf_files/opal_azure-pipeline.csv @@ -6,7 +6,7 @@ "ds.asNumeric::perf:0","2.185","0.5","2" "ds.assign::perf::0","5.490","0.5","2" "ds.class::perf::combine:0","4.760","0.5","2" -"ds.colnames::perf:0","4.159","0.5","2" +"ds.colnames::perf:0","9.079","0.5","2" "ds.exists::perf::combine:0","11.09","0.5","2" "ds.length::perf::combine:0","9.479","0.5","2" "ds.mean::perf::combine:0","9.650","0.5","2"