R Under development (unstable) (2024-01-26 r85832 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## unit tests will not be done if RUnit is not available > if(require("RUnit", quietly=TRUE)) { + + ## --- Setup --- + + pkg <- "robustrank" # <-- Change to package name! + if(Sys.getenv("RCMDCHECK") == "FALSE") { + ## Path to unit tests for standalone running under Makefile (not R CMD check) + ## PKG/tests/../inst/unitTests + path <- file.path(getwd(), "unitTests") + } else { + ## Path to unit tests for R CMD check + ## PKG.Rcheck/tests/../PKG/unitTests + path <- system.file("unitTests", package=pkg) + } + cat("\nRunning unit tests\n") + print(list(pkg=pkg, getwd=getwd(), pathToUnitTests=path)) + + library(package=pkg, character.only=TRUE) + + ## If desired, load the name space to allow testing of private functions + ## if (is.element(pkg, loadedNamespaces())) + ## attach(loadNamespace(pkg), name=paste("namespace", pkg, sep=":"), pos=3) + ## + ## or simply call PKG:::myPrivateFunction() in tests + + ## --- Testing --- + + ## Define tests + testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), + dirs=path) + ## Run + tests <- runTestSuite(testSuite) + + ## Default report name + pathReport <- tempdir() + + ## Report to stdout and text files + cat("------------------- UNIT TEST SUMMARY ---------------------\n\n") + printTextProtocol(tests, showDetails=FALSE) + # printTextProtocol(tests, showDetails=FALSE, + # fileName=paste(pathReport, "Summary.txt", sep="")) + # printTextProtocol(tests, showDetails=TRUE, + # fileName=paste(pathReport, ".txt", sep="")) + # + # ## Report to HTML file + # printHTMLProtocol(tests, fileName=paste(pathReport, ".html", sep="")) + + ## Return stop() to cause R CMD check stop in case of + ## - failures i.e. FALSE to unit tests or + ## - errors i.e. R errors + tmp <- getErrors(tests) + if(tmp$nFail > 0 | tmp$nErr > 0) { + stop(paste("\n\nunit testing failed (#test failures: ", tmp$nFail, + ", #R errors: ", tmp$nErr, ")\n\n", sep="")) + } + } else { + warning("cannot run unit tests -- package RUnit is not available") + } Running unit tests $pkg [1] "robustrank" $getwd [1] "d:/RCompile/CRANincoming/R-devel/robustrank.Rcheck/tests" $pathToUnitTests [1] "D:/temp/RtmpeG9lMH/RLIBS_119e01b5e136d/robustrank/unitTests" Loading required package: kyotil Executing test function test.mod.wmw.test ... done successfully. Executing test function test.mw.mw.2.perm ... n.perm = 640 ; p.method = exact done successfully. Executing test function test.pair.wmw ... [1] 0.5955556 [1] 0.5955556 [1] 0.5955556 [1] 0.5955556 [1] 0.5955556 [1] 0.5955556 [1] 0.5955556 [1] 0.5955556 [1] 0.5955556 [1] 0.52 [1] 0.5733333 [1] 0.4844444 [1] 0.6577778 [1] 0.5377778 [1] 0.4311111 [1] 0.5422222 [1] 0.5466667 [1] 0.6 [1] 0.52 [1] 0.32 [1] 0.32 [1] 0.52 [1] 0.28 [1] 0.48 [1] 0.48 [1] 0.68 [1] 0.44 [1] 0.64 [1] 0.2 [1] 0.4 [1] 0.16 [1] 0.36 [1] 0.36 [1] 0.56 [1] 0.32 [1] 0.52 [1] 0.48 [1] 0.68 [1] 0.44 [1] 0.64 [1] 0.64 [1] 0.84 [1] 0.6 [1] 0.8 [1] 0.36 [1] 0.56 [1] 0.32 [1] 0.52 [1] 0.52 [1] 0.72 [1] 0.48 [1] 0.68 [1] 0.32 [1] 0.32 [1] 0.52 [1] 0.28 [1] 0.48 [1] 0.48 [1] 0.68 [1] 0.44 [1] 0.64 [1] 0.2 [1] 0.4 [1] 0.16 [1] 0.36 [1] 0.36 [1] 0.56 [1] 0.32 [1] 0.52 [1] 0.48 [1] 0.68 [1] 0.44 [1] 0.64 [1] 0.64 [1] 0.84 [1] 0.6 [1] 0.8 [1] 0.36 [1] 0.56 [1] 0.32 [1] 0.52 [1] 0.52 [1] 0.72 [1] 0.48 [1] 0.68 done successfully. Executing test function test.paired.with.replicates ... done successfully. Executing test function test.pm ... call wilcox.test for paired data since there are no unpaired samples switch two samples m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 switch two samples m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 m = 9 ; n = 1 ; lx = 0 [1] 1.00000 12.90123 [1] 0.1568423 0.8333333 m = 10 ; n = 10 ; lx = 0 m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 m = 10 ; n = 10 ; lx = 10 SR: comb [1] 10.38961 6.00000 6.00000 6.00000 v.tmp [,1] [,2] [,3] [,4] [1,] 0.09625000 0.03416667 0.08238889 0.00000000 [2,] 0.03416667 0.16666667 -0.02233333 0.08333333 [3,] 0.08238889 -0.02233333 0.16666667 0.08333333 [4,] 0.00000000 0.08333333 0.08333333 0.16666667 MW: comb [1] 8.372853 6.000000 6.000000 6.000000 v.tmp [,1] [,2] [,3] [,4] [1,] 0.1194336 0.06100000 0.06100000 0.00000000 [2,] 0.0610000 0.16666667 -0.02233333 0.08333333 [3,] 0.0610000 -0.02233333 0.16666667 0.08333333 [4,] 0.0000000 0.08333333 0.08333333 0.16666667 m = 10 ; n = 10 ; lx = 10 SR: comb [1] 10.38961 6.00000 6.00000 6.00000 v.tmp [,1] [,2] [,3] [,4] [1,] 0.09625000 0.03416667 0.08238889 0.00000000 [2,] 0.03416667 0.16666667 -0.02233333 0.08333333 [3,] 0.08238889 -0.02233333 0.16666667 0.08333333 [4,] 0.00000000 0.08333333 0.08333333 0.16666667 MW: comb [1] 8.372853 6.000000 6.000000 6.000000 v.tmp [,1] [,2] [,3] [,4] [1,] 0.1194336 0.06100000 0.06100000 0.00000000 [2,] 0.0610000 0.16666667 -0.02233333 0.08333333 [3,] 0.0610000 -0.02233333 0.16666667 0.08333333 [4,] 0.0000000 0.08333333 0.08333333 0.16666667 m = 10 ; n = 10 ; lx = 10 SR: comb [1] 10.38961 6.00000 6.00000 6.00000 v.tmp [,1] [,2] [,3] [,4] [1,] 0.09625000 0.03416667 0.08238889 0.00000000 [2,] 0.03416667 0.16666667 -0.02233333 0.08333333 [3,] 0.08238889 -0.02233333 0.16666667 0.08333333 [4,] 0.00000000 0.08333333 0.08333333 0.16666667 MW: comb [1] 8.372853 6.000000 6.000000 6.000000 v.tmp [,1] [,2] [,3] [,4] [1,] 0.1194336 0.06100000 0.06100000 0.00000000 [2,] 0.0610000 0.16666667 -0.02233333 0.08333333 [3,] 0.0610000 -0.02233333 0.16666667 0.08333333 [4,] 0.0000000 0.08333333 0.08333333 0.16666667 m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 switch two samples m = 10 ; n = 10 ; lx = 0 [1] 1.0000 2.4255 [1] 0.1194336 0.1666667 done successfully. ------------------- UNIT TEST SUMMARY --------------------- RUNIT TEST PROTOCOL -- Sun Jan 28 06:05:45 2024 *********************************************** Number of test functions: 5 Number of errors: 0 Number of failures: 0 1 Test Suite : robustrank unit testing - 5 test functions, 0 errors, 0 failures There were 16 warnings (use warnings() to see them) > > proc.time() user system elapsed 1.04 0.15 1.20