From 6ec5696737fd3edc39f5d427f9eb268bd33c1721 Mon Sep 17 00:00:00 2001 From: Gregory Demin Date: Tue, 11 Dec 2018 23:13:07 +0300 Subject: [PATCH] Fixes for release --- DESCRIPTION | 4 ++-- NAMESPACE | 12 ++++++------ NEWS | 2 +- R/html_table.R | 12 ++++++------ R/if_val.R | 2 +- R/significance_pvalue.R | 2 +- tests/testthat/test_xl_write.R | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 20f9f109..873360b9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: expss Type: Package Title: Tables with Labels and Some Useful Functions from Spreadsheets and 'SPSS' Statistics -Version: 0.8.9 -Date: 2018-12-11 +Version: 0.8.10 +Date: 2018-12-12 Maintainer: Gregory Demin Authors@R: person("Gregory", "Demin", email = "gdemin@gmail.com", role = c("aut", "cre")) diff --git a/NAMESPACE b/NAMESPACE index 133f4bd3..13e13781 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -691,12 +691,12 @@ export(write_labels) export(write_labels_spss) export(xl_write) if(getRversion() >= "3.6.0") { -S3method(knitr::knit_print, "etable") -S3method(knitr::knit_print, "with_caption") -S3method(repr::repr_html, "etable") -S3method(repr::repr_html, "with_caption") -S3method(repr::repr_text, "etable") -S3method(repr::repr_text, "with_caption") +S3method(knitr::knit_print, etable) +S3method(knitr::knit_print, with_caption) +S3method(repr::repr_html, etable) +S3method(repr::repr_html, with_caption) +S3method(repr::repr_text, etable) +S3method(repr::repr_text, with_caption) } else { export(knit_print.etable) export(knit_print.with_caption) diff --git a/NEWS b/NEWS index 04054077..08f62816 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -0.8.9 (11.12.2018) +0.8.10 (12.12.2018) ================ * 'nest' - more consistent behaviour for 'a %nest% list(x, y, z)` * 'split_off' now respects data.table and etable classes diff --git a/R/html_table.R b/R/html_table.R index 7bdab592..10d249f9 100644 --- a/R/html_table.R +++ b/R/html_table.R @@ -310,12 +310,12 @@ matrix_to_cgroup = function(header){ } #' @rawNamespace if(getRversion() >= "3.6.0") { -#' S3method(knitr::knit_print, "etable") -#' S3method(knitr::knit_print, "with_caption") -#' S3method(repr::repr_html, "etable") -#' S3method(repr::repr_html, "with_caption") -#' S3method(repr::repr_text, "etable") -#' S3method(repr::repr_text, "with_caption") +#' S3method(knitr::knit_print, etable) +#' S3method(knitr::knit_print, with_caption) +#' S3method(repr::repr_html, etable) +#' S3method(repr::repr_html, with_caption) +#' S3method(repr::repr_text, etable) +#' S3method(repr::repr_text, with_caption) #' } else { #' export(knit_print.etable) #' export(knit_print.with_caption) diff --git a/R/if_val.R b/R/if_val.R index 684a7889..1f4f8df0 100644 --- a/R/if_val.R +++ b/R/if_val.R @@ -435,7 +435,7 @@ into_internal = function(values, variables_names, envir){ enclos = baseenv()) variables_names = flat_list(variables_names) # strange condition because of missing(...) doesn't work - if(length(variables_names)==1 && is.character(variables_names[[1]]) && variables_names[[1]]==""){ + if(length(variables_names)==1 && identical(variables_names[[1]], "")){ stopif(!is.list(values), "Unboxing can be applied only to list/data.frame.") variables_names = names(values) stopif(is.null(variables_names), "There are no names in 'x'.") diff --git a/R/significance_pvalue.R b/R/significance_pvalue.R index 10ca3852..e89777f3 100644 --- a/R/significance_pvalue.R +++ b/R/significance_pvalue.R @@ -76,7 +76,7 @@ compare_means = function(mean1, mean2, sd1, sd2, base1, base2, common_base = 0, # ftp://public.dhe.ibm.com/software/analytics/spss/documentation/statistics/20.0/en/client/Manuals/IBM_SPSS_Statistics_Algorithms.pdf # IBM SPSS Statistics Algorithms v20, p. 267 if_na(common_base) = 0 - if(common_base>0 || var_equal){ + if(any(common_base>0) || var_equal){ pooled_sd = sqrt((sd1*sd1*(base1 - 1) + sd2*sd2*(base2 - 1))/(base1 + base2 - 2)) t_statistic = (mean1 - mean2)/ pooled_sd/sqrt(1/base1 + 1/base2 - 2*common_base/base1/base2) diff --git a/tests/testthat/test_xl_write.R b/tests/testthat/test_xl_write.R index cda42baf..cbe92e8c 100644 --- a/tests/testthat/test_xl_write.R +++ b/tests/testthat/test_xl_write.R @@ -247,7 +247,7 @@ if(require(openxlsx, quietly = TRUE, warn.conflicts = FALSE)){ res = xl_write(res_list, wb, sh, row = 1, col = 1, gap = 2, rownames = TRUE) # saveWorkbook(wb, "tables.xlsx", overwrite = TRUE) - context("custom format") + # context("custom format") mtcars = apply_labels(mtcars, mpg = "Miles/(US) gallon", hp = "Gross horsepower"