From 99de0f6ab427723e11bcbd684ccf60b8750dada6 Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Mon, 10 Aug 2015 12:38:04 -0400 Subject: [PATCH 01/12] Fix wrong VignetteIndexEntry for SMD vignette --- vignettes/smd.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/smd.Rmd b/vignettes/smd.Rmd index 310788b..149efd4 100644 --- a/vignettes/smd.Rmd +++ b/vignettes/smd.Rmd @@ -4,7 +4,7 @@ author: "Kazuki Yoshida" date: "2015-08-07" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Introduction to tableone} + %\VignetteIndexEntry{Using standardized mean differences} %\VignetteEngine{knitr::rmarkdown} \usepackage[utf8]{inputenc} --- From c45e2ae88a5f2dd74518a2d5ccf48e9b61e32232 Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Mon, 10 Aug 2015 16:30:12 -0400 Subject: [PATCH 02/12] Bump version to tentative 0.7.1 --- DESCRIPTION | 2 +- NEWS | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 333376d..29d2609 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tableone Type: Package Title: Create "Table 1" to Describe Baseline Characteristics -Version: 0.7.0 +Version: 0.7.1 Date: 2015-08-10 Author: Kazuki Yoshida, Justin Bohn. Maintainer: Kazuki Yoshida diff --git a/NEWS b/NEWS index 225ccbb..6738caa 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +tableone 0.7.1 (2015-08-10) +---------------------------------------------------------------- + +NEW DEVELOPMENTAL VERSION + + tableone 0.7.0 (2015-08-10) ---------------------------------------------------------------- From e1ecb5176e0d687063635bbaa8ba835be1ad860d Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 09:12:39 -0400 Subject: [PATCH 03/12] Avoid ERROR on sparc-sun-solaris2.10 (32-bit) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests failed on sparc-sun-solaris2 after CRAN upload http://www.r-project.org/nosvn/R.check/r-patched-solaris-sparc/tableone-00check.html using R version 3.2.2 RC (2015-08-10 r68985) using platform: sparc-sun-solaris2.10 (32-bit) this is package ‘tableone’ version ‘0.7.0’ checking tests ... ERROR Running the tests in ‘tests/test-all.R’ failed. Last 13 lines of output: Y 0.7311319 0.001480611 0.001486405 1.216879 1.216879 1.216879 5.793469e-06 C1 NaN NaN NaN NaN NaN NaN NaN 2 vs 4 2 vs 5 2 vs 6 3 vs 4 3 vs 5 3 vs 6 4 vs 5 4 vs 6 5 vs 6 Y 1.218891 1.218891 1.218891 1.218899 1.218899 1.218899 0 0 0 C1 NaN NaN NaN NaN NaN NaN NaN NaN NaN testthat results ================================================================ OK: 381 SKIPPED: 0 FAILED: 3 1. Failure (at test-modules-smd.R#443): decent results are returned for anomalous/difficult data 2. Failure (at test-modules-smd.R#470): decent results are returned for anomalous/difficult data 3. Failure (at test-modules-smd.R#471): decent results are returned for anomalous/difficult data Error: testthat unit tests failed Execution halted --- tests/testthat/test-modules-smd.R | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-modules-smd.R b/tests/testthat/test-modules-smd.R index f1d46ce..96fe2f4 100755 --- a/tests/testthat/test-modules-smd.R +++ b/tests/testthat/test-modules-smd.R @@ -440,8 +440,11 @@ test_that("decent results are returned for anomalous/difficult data", { means1 <- svyby(~ onlyOne, by = ~ RIAGENDR, nhanesSvy, FUN = svymean)[,2] vars1 <- svyby(~ onlyOne, by = ~ RIAGENDR, nhanesSvy, FUN = svyvar)[,2] ## Very small difference is inflated by even smaller variance - expect_equal(svyStdDiff("onlyOne", "RIAGENDR", nhanesSvy), - (means1[1] - means1[2]) / sqrt(sum(vars1) / 2)) + if (!grepl("sparc", R.Version()$platform, ignore.case = TRUE)) { + ## Cannot run on sparc-sun-solaris due to lack of extended precision arithmetic + expect_equal(svyStdDiff("onlyOne", "RIAGENDR", nhanesSvy), + (means1[1] - means1[2]) / sqrt(sum(vars1) / 2)) + } ## NaN should be the case, but it's not, but it's consistent with survey ## expect_equal(svyStdDiff("onlyOne", "RIAGENDR", nhanesSvy), NaN) @@ -467,8 +470,11 @@ test_that("decent results are returned for anomalous/difficult data", { (means2[2] - means2[3]) / sqrt((vars2[2] + vars2[3]) / 2), (means2[2] - means2[4]) / sqrt((vars2[2] + vars2[4]) / 2), (means2[3] - means2[4]) / sqrt((vars2[3] + vars2[4]) / 2)) - expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), meanDiffs2) - expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), rep(NaN, 6)) + if (!grepl("sparc", R.Version()$platform, ignore.case = TRUE)) { + ## Cannot run on sparc-sun-solaris due to lack of extended precision arithmetic + expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), meanDiffs2) + expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), rep(NaN, 6)) + } ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0 expect_equal(svyStdDiffMulti("onlyOne", "race", nhanesSvy), rep(NaN, 6)) From a48625699e2303e2fd169b0283847c50e731aed8 Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 10:38:57 -0400 Subject: [PATCH 04/12] Describe bug fixes --- DESCRIPTION | 2 +- NEWS | 9 +++++++-- cran-check.txt | 8 +++++--- tableone.Rcheck/tableone-Ex.Rout | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 29d2609..8b2ad06 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: tableone Type: Package Title: Create "Table 1" to Describe Baseline Characteristics Version: 0.7.1 -Date: 2015-08-10 +Date: 2015-08-11 Author: Kazuki Yoshida, Justin Bohn. Maintainer: Kazuki Yoshida Description: Creates "Table 1", i.e., description of baseline patient diff --git a/NEWS b/NEWS index 6738caa..5733622 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,12 @@ -tableone 0.7.1 (2015-08-10) +tableone 0.7.1 (2015-08-11) ---------------------------------------------------------------- -NEW DEVELOPMENTAL VERSION +BUG FIXES + +* Solve problems with unit testing on the sparc architecture + without extended-precision arithmetic support. + +* Fix title for second vignette. tableone 0.7.0 (2015-08-10) diff --git a/cran-check.txt b/cran-check.txt index 80df09b..9095c34 100644 --- a/cran-check.txt +++ b/cran-check.txt @@ -5,9 +5,11 @@ * using option ‘--as-cran’ * checking for file ‘tableone/DESCRIPTION’ ... OK * checking extension type ... Package -* this is package ‘tableone’ version ‘0.7.0’ -* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers +* this is package ‘tableone’ version ‘0.7.1’ +* checking CRAN incoming feasibility ... NOTE Maintainer: ‘Kazuki Yoshida ’ + +Days since last update: 1 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK @@ -62,4 +64,4 @@ Maintainer: ‘Kazuki Yoshida ’ * checking re-building of vignette outputs ... OK * checking PDF version of manual ... OK * DONE -Status: OK +Status: 1 NOTE diff --git a/tableone.Rcheck/tableone-Ex.Rout b/tableone.Rcheck/tableone-Ex.Rout index 2d42704..fec9946 100644 --- a/tableone.Rcheck/tableone-Ex.Rout +++ b/tableone.Rcheck/tableone-Ex.Rout @@ -3273,7 +3273,7 @@ detaching ‘package:survey’, ‘package:grid’ > ### > options(digits = 7L) > base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n") -Time elapsed: 4.533 0.144 4.746 0.005 0.007 +Time elapsed: 3.646 0.098 3.78 0.005 0.006 > grDevices::dev.off() null device 1 From 90da9eb5b67dc0cab1b71cc493dbe349c8f4c837 Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 11:26:33 -0400 Subject: [PATCH 05/12] Update CRAN submission note --- cran-comment.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cran-comment.md b/cran-comment.md index 65791de..f7e9cdf 100644 --- a/cran-comment.md +++ b/cran-comment.md @@ -1,18 +1,18 @@ ## What's new -* Weighted data support -* Standardized mean difference support +* Solve problems with unit testing on the sparc architecture without extended-precision arithmetic support. +* Fix title for second vignette. ## Test environments -* Local OS X 10.10.4, R 3.2.1; R-devel (2015-08-06 r68871) +* Local OS X 10.10.4, R 3.2.1 * Ubuntu Linux (on Travis-CI), R 3.2.1 -* winb-builder (devel and release) +* win-builder (devel and release) ## R CMD check results * ERRORs: None * WARNINGs: None * NOTEs: - - Package author e-mail confirmation. - - "No repository set, so cyclic dependency check skipped" on R 3.2.1 on win-builder (not a package problem) + - Author e-mail check + - Short interval from last submission (0.7.0 on 2015-08-10) ## Downstream dependencies -RcmdrPlugin.EZR GUI frontend: Manually examined "Summary table of sample characteristics" for compatibility; EZR author also examined compatibility. +RcmdrPlugin.EZR GUI frontend: No change was made to APIs. From 1fa68fc073669ff29e1f44fb40b4075526b19856 Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 14:08:42 -0400 Subject: [PATCH 06/12] Clarify reason for update --- cran-comment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cran-comment.md b/cran-comment.md index f7e9cdf..a2339d8 100644 --- a/cran-comment.md +++ b/cran-comment.md @@ -1,5 +1,5 @@ ## What's new -* Solve problems with unit testing on the sparc architecture without extended-precision arithmetic support. +* Solve problems with unit testing on the sparc architecture without extended-precision arithmetic support at request of a CRAN maintainer. * Fix title for second vignette. ## Test environments From ded232f50b6b0356c3590a010be3f45d0685b645 Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 19:04:41 -0400 Subject: [PATCH 07/12] Comment on use of NaN for [0]^-1 case in (svy)StdDiffMulti --- tests/testthat/test-modules-smd.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-modules-smd.R b/tests/testthat/test-modules-smd.R index 96fe2f4..4d87f75 100755 --- a/tests/testthat/test-modules-smd.R +++ b/tests/testthat/test-modules-smd.R @@ -459,7 +459,7 @@ test_that("decent results are returned for anomalous/difficult data", { ## NaN due to division by zero variance by(nhanes$onlyOne, nhanes$race, summary) expect_equal(StdDiff(nhanes$onlyOne, group = nhanes$race), rep(NaN, 6)) - ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0 + ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0; defined NaN in (svy)StdDiffMulti expect_equal(StdDiffMulti(nhanes$onlyOne, group = nhanes$race), rep(NaN, 6)) ## When weighted problematic; not in this case?? means2 <- svyby(~ onlyOne, by = ~ race, nhanesSvy, FUN = svymean)[,2] @@ -496,7 +496,7 @@ test_that("decent results are returned for anomalous/difficult data", { expect_warning(expect_equal(svyStdDiff("onlyNa", "RIAGENDR", nhanesSvy), as.numeric(NA)), "onlyNa has only NA's in at least one stratum. na.rm turned off.") - ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0 + ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0; defined NaN in (svy)StdDiffMulti expect_warning(expect_equal(svyStdDiffMulti("onlyNa", "RIAGENDR", nhanesSvy), NaN), "onlyNa has only NA's in all strata. Regarding NA as a level.") @@ -504,7 +504,7 @@ test_that("decent results are returned for anomalous/difficult data", { ## NaN due to division by zero variance expect_warning(expect_equal(StdDiff(nhanes$onlyNa, group = nhanes$race), rep(NaN, 6)), "Variable has only NA's in at least one stratum. na.rm turned off.") - ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0 + ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0; defined NaN in (svy)StdDiffMulti expect_warning(expect_equal(StdDiffMulti(nhanes$onlyNa, group = nhanes$race), rep(NaN, 6)), "Variable has only NA's in all strata. Regarding NA as a level.") ## When weighted problematic; not in this case?? @@ -520,7 +520,7 @@ test_that("decent results are returned for anomalous/difficult data", { "onlyNa has only NA's in at least one stratum. na.rm turned off.") expect_warning(expect_equal(svyStdDiff("onlyNa", "race", nhanesSvy), rep(NaN, 6)), "onlyNa has only NA's in at least one stratum. na.rm turned off.") - ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0 + ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0; defined NaN in (svy)StdDiffMulti expect_warning(expect_equal(svyStdDiffMulti("onlyNa", "race", nhanesSvy), rep(NaN, 6)), "onlyNa has only NA's in all strata. Regarding NA as a level.") From 0e6e22e9285b119822fca0003a579da91f66ae6e Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 19:05:51 -0400 Subject: [PATCH 08/12] Correctly use abs(smd) as reference (abs() was not present) --- tests/testthat/test-modules-smd.R | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/testthat/test-modules-smd.R b/tests/testthat/test-modules-smd.R index 4d87f75..080eb06 100755 --- a/tests/testthat/test-modules-smd.R +++ b/tests/testthat/test-modules-smd.R @@ -433,22 +433,21 @@ test_that("decent results are returned for anomalous/difficult data", { ## NaN due to division by zero variance by(nhanes$onlyOne, nhanes$RIAGENDR, summary) expect_equal(StdDiff(nhanes$onlyOne, group = nhanes$RIAGENDR), NaN) - ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0 + ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0; defined NaN in (svy)StdDiffMulti table(nhanes$onlyOne, nhanes$RIAGENDR) expect_equal(StdDiffMulti(nhanes$onlyOne, group = nhanes$RIAGENDR), NaN) ## When weighted problematic means1 <- svyby(~ onlyOne, by = ~ RIAGENDR, nhanesSvy, FUN = svymean)[,2] vars1 <- svyby(~ onlyOne, by = ~ RIAGENDR, nhanesSvy, FUN = svyvar)[,2] ## Very small difference is inflated by even smaller variance - if (!grepl("sparc", R.Version()$platform, ignore.case = TRUE)) { - ## Cannot run on sparc-sun-solaris due to lack of extended precision arithmetic - expect_equal(svyStdDiff("onlyOne", "RIAGENDR", nhanesSvy), - (means1[1] - means1[2]) / sqrt(sum(vars1) / 2)) - } + ## on sparc-sun-solaris sign was opposite; abs() solves this issue + ## as svyStdDiff() uses abs() internally + expect_equal(svyStdDiff("onlyOne", "RIAGENDR", nhanesSvy), + abs((means1[1] - means1[2]) / sqrt(sum(vars1) / 2))) ## NaN should be the case, but it's not, but it's consistent with survey ## expect_equal(svyStdDiff("onlyOne", "RIAGENDR", nhanesSvy), NaN) - ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0 + ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0; defined NaN in (svy)StdDiffMulti ## No error even with a single level variable (constant) as redundant ## level drop from table occurs only when 2+ levels are present. ## If any group has more than 2 levels, then strata-by-level table @@ -470,12 +469,15 @@ test_that("decent results are returned for anomalous/difficult data", { (means2[2] - means2[3]) / sqrt((vars2[2] + vars2[3]) / 2), (means2[2] - means2[4]) / sqrt((vars2[2] + vars2[4]) / 2), (means2[3] - means2[4]) / sqrt((vars2[3] + vars2[4]) / 2)) + ## on sparc-sun-solaris sign was opposite; abs() solves this issue + ## as svyStdDiff() uses abs() internally + expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), abs(meanDiffs2)) + if (!grepl("sparc", R.Version()$platform, ignore.case = TRUE)) { ## Cannot run on sparc-sun-solaris due to lack of extended precision arithmetic - expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), meanDiffs2) expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), rep(NaN, 6)) } - ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0 + ## 0 because [0]^- = 0, and [1]^T [0]^-1 [1] = 0; defined NaN in (svy)StdDiffMulti expect_equal(svyStdDiffMulti("onlyOne", "race", nhanesSvy), rep(NaN, 6)) From d528f3d1c416bd6a965b32fb9a20396e2bd3c076 Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 19:20:59 -0400 Subject: [PATCH 09/12] Comment on equivalence to c(NaN,6), which fails if long double is disabled The following configuration before make/make install reproduces this problem. ./configure --disable-long-double In most platforms this option is enabled, and the result returned is rep(NaN,6). But on sparc-sun-solaris, it is disabled, and gives the following error, which can be reproduced with --disable-long-double option. 1. Failure (at test-modules-smd.R#478): decent results are returned for anomalous/difficult data ------------------- svyStdDiff("onlyOne", "race", nhanesSvy) not equal to rep(NaN, 6) 6/6 mismatches (average diff: NaN). First 6: pos x y diff 1 NaN 0.117 NaN 2 NaN 1.987 NaN 3 NaN 1.129 NaN 4 NaN 1.997 NaN 5 NaN 1.162 NaN 6 NaN 1.608 NaN TODO: If the denominator is sufficienctly close to zero by some small tolerance value, the result should be forced to be NaN. --- tests/testthat/test-modules-smd.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-modules-smd.R b/tests/testthat/test-modules-smd.R index 080eb06..1116732 100755 --- a/tests/testthat/test-modules-smd.R +++ b/tests/testthat/test-modules-smd.R @@ -472,7 +472,7 @@ test_that("decent results are returned for anomalous/difficult data", { ## on sparc-sun-solaris sign was opposite; abs() solves this issue ## as svyStdDiff() uses abs() internally expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), abs(meanDiffs2)) - + ## This one is rep(NaN,6) for most platforms except for sparc-sun-solaris if (!grepl("sparc", R.Version()$platform, ignore.case = TRUE)) { ## Cannot run on sparc-sun-solaris due to lack of extended precision arithmetic expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), rep(NaN, 6)) From 0a16b837e8e91805cb12b829cb9d5e9bd3ac15ee Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 19:33:01 -0400 Subject: [PATCH 10/12] Add warning comment about fragile lower.tri() approach of data extraction. Extracting mean differences from a matrix created by outer() using lower.tri() is only correct is abs() is used. The stated comparisons are 1vs2, 1vs3, 1vs4, etc. But the contrasts extracted by lower.tri() are 2vs1, 3vs1, 4vs1, etc, i.e. the opposite mean contrasts giving values with the opposite sign. If abs() is used as the value is really a distance measure, this problem does not surface. --- R/modules-smd.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/modules-smd.R b/R/modules-smd.R index 14d574f..b0ad3e8 100644 --- a/R/modules-smd.R +++ b/R/modules-smd.R @@ -191,6 +191,8 @@ StdDiff <- function(variable, group, binary = FALSE, na.rm = TRUE) { out <- meanDiffs / sqrt(varMeans) + ## This lower.tri() approach is actually giving 2vs1, 3vs1, etc + ## opposite of stated 1vs2, 1vs3. Only correct is abs() is used. abs(out[lower.tri(out)]) } @@ -277,6 +279,8 @@ svyStdDiff <- function(varName, groupName, design, binary = FALSE, na.rm = TRUE) out <- meanDiffs / sqrt(varMeans) + ## This lower.tri() approach is actually giving 2vs1, 3vs1, etc + ## opposite of stated 1vs2, 1vs3. Only correct is abs() is used. abs(out[lower.tri(out)]) } From 881b3e21bdf1df7c32f549cc1863df8bb73f56eb Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 19:45:55 -0400 Subject: [PATCH 11/12] Check for long.double support instead of sparc platform in unit tests The SPARC platform has a different behavior due to the --disable-long-double configuration. This can be checked using capabilities()["long.double"] boolean flag. --- R/modules-smd.R | 4 ++-- tests/testthat/test-modules-smd.R | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/R/modules-smd.R b/R/modules-smd.R index b0ad3e8..c3db174 100644 --- a/R/modules-smd.R +++ b/R/modules-smd.R @@ -192,7 +192,7 @@ StdDiff <- function(variable, group, binary = FALSE, na.rm = TRUE) { out <- meanDiffs / sqrt(varMeans) ## This lower.tri() approach is actually giving 2vs1, 3vs1, etc - ## opposite of stated 1vs2, 1vs3. Only correct is abs() is used. + ## opposite of stated 1vs2, 1vs3. Only correct if abs() is used. abs(out[lower.tri(out)]) } @@ -280,7 +280,7 @@ svyStdDiff <- function(varName, groupName, design, binary = FALSE, na.rm = TRUE) out <- meanDiffs / sqrt(varMeans) ## This lower.tri() approach is actually giving 2vs1, 3vs1, etc - ## opposite of stated 1vs2, 1vs3. Only correct is abs() is used. + ## opposite of stated 1vs2, 1vs3. Only correct if abs() is used. abs(out[lower.tri(out)]) } diff --git a/tests/testthat/test-modules-smd.R b/tests/testthat/test-modules-smd.R index 1116732..0aea407 100755 --- a/tests/testthat/test-modules-smd.R +++ b/tests/testthat/test-modules-smd.R @@ -473,7 +473,11 @@ test_that("decent results are returned for anomalous/difficult data", { ## as svyStdDiff() uses abs() internally expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), abs(meanDiffs2)) ## This one is rep(NaN,6) for most platforms except for sparc-sun-solaris - if (!grepl("sparc", R.Version()$platform, ignore.case = TRUE)) { + ## where ./configure --disable-long-double is used. + ## capabilities()["long.double"] was added in R 3.1.3. + ## As of 2015-08-11, only r-oldrel-windows-ix86+x86_64 is R 3.1.3. + ## https://cran.r-project.org/web/checks/check_results_tableone.html + if (capabilities()["long.double"]) { ## Cannot run on sparc-sun-solaris due to lack of extended precision arithmetic expect_equal(svyStdDiff("onlyOne", "race", nhanesSvy), rep(NaN, 6)) } From 27273ab3c916a431e5e26ed27fc2c7b78082e695 Mon Sep 17 00:00:00 2001 From: kaz-yos Date: Tue, 11 Aug 2015 20:34:47 -0400 Subject: [PATCH 12/12] Update CRAN submission comment with all testing platforms --- cran-comment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cran-comment.md b/cran-comment.md index a2339d8..1550746 100644 --- a/cran-comment.md +++ b/cran-comment.md @@ -3,7 +3,7 @@ * Fix title for second vignette. ## Test environments -* Local OS X 10.10.4, R 3.2.1 +* Local OS X 10.10.4, R 3.2.1 (--disable-long-double) and R develop * Ubuntu Linux (on Travis-CI), R 3.2.1 * win-builder (devel and release)