CRAN Package Check Results for Package gMWT

Last updated on 2019-12-11 00:49:19 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.1 27.22 52.53 79.75 ERROR
r-devel-linux-x86_64-debian-gcc 1.1 20.25 48.55 68.80 OK
r-devel-linux-x86_64-fedora-clang 1.1 112.65 NOTE
r-devel-linux-x86_64-fedora-gcc 1.1 117.08 NOTE
r-devel-windows-ix86+x86_64 1.1 50.00 136.00 186.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.1 52.00 104.00 156.00 OK
r-patched-linux-x86_64 1.1 23.38 57.11 80.49 OK
r-patched-solaris-x86 1.1 125.90 OK
r-release-linux-x86_64 1.1 23.78 57.67 81.45 OK
r-release-windows-ix86+x86_64 1.1 42.00 97.00 139.00 OK
r-release-osx-x86_64 1.1 OK
r-oldrel-windows-ix86+x86_64 1.1 38.00 84.00 122.00 OK
r-oldrel-osx-x86_64 1.1 OK

Check Details

Version: 1.1
Check: examples
Result: ERROR
    Running examples in 'gMWT-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: getSigTests
    > ### Title: Extract Significant Test Results for a Given Alpha or Different
    > ### Multiple Testing Corrections.
    > ### Aliases: getSigTests
    > ### Keywords: methods
    >
    > ### ** Examples
    >
    > X <- matrix(c(rnorm(500,2,1),rnorm(600,2,1),rnorm(400,2.2,1)),byrow=TRUE, ncol=10)
    > colnames(X) <- letters[1:10]
    > g <- c(rep(1,50),rep(2,60),rep(3,40))
    > test <- gmw(X,g,test="kw",type="external")
    > cs1 <- getSigTests(test)
    > cs1
    $sigTests
    [1] 6
    
    >
    > simData <- runif(1000,0,1)
    > simData <- c(simData,runif(200,0,0.01))
    > simData2 <- runif(1000,0,1)
    > simData2 <- c(simData2,runif(200,0,0.01))
    >
    > simDataMat <- rbind(simData,simData2)
    >
    > getSigTests(simDataMat, method="bon")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    gMWT
     --- call from context ---
    getSigTests(simDataMat, method = "bon")
     --- call from argument ---
    if (class(pvalues) != "gmw") {
     temp <- pvalues
     pvalues <- list()
     pvalues$p.values <- temp
    }
     --- R stacktrace ---
    where 1: getSigTests(simDataMat, method = "bon")
    
     --- value of length: 2 type: logical ---
    [1] TRUE TRUE
     --- function from context ---
    function (pvalues, alpha = 0.05, method = "plain")
    {
     method <- match.arg(method, c("plain", "bonferroni", "simes",
     "bh", "csD", "csR", "maxT"))
     ifelse((is.numeric(pvalues)) & (!is.matrix(pvalues)), isVector <- TRUE,
     isVector <- FALSE)
     getSigTests.internal <- function(pvalues, alpha, method) {
     multAlpha <- NULL
     sigPvalues <- NULL
     sigTests <- NULL
     if (method == "plain") {
     sigTests <- which((pvalues <= alpha) == TRUE)
     sigPvalues <- pvalues[sigTests]
     }
     else if (method == "bonferroni") {
     bonAlpha <- alpha/length(pvalues)
     sigTests <- which((pvalues <= bonAlpha) == TRUE)
     sigPvalues <- pvalues[sigTests]
     multAlpha <- bonAlpha
     }
     else if (method == "simes") {
     pvalues.sorted <- sort(pvalues)
     bonAlpha <- alpha/length(pvalues)
     simAlpha <- bonAlpha * 1:length(pvalues)
     imax <- which((pvalues.sorted <= simAlpha) == TRUE)
     if (sum(imax) > 0) {
     imax <- max(imax)
     sigTests <- which((pvalues <= imax * bonAlpha) ==
     TRUE)
     sigPvalues <- pvalues[sigTests]
     multAlpha <- imax * bonAlpha
     }
     }
     else if (method == "bh") {
     pvalues.sorted <- sort(pvalues)
     kmax <- which((pvalues.sorted <= alpha * (1:length(pvalues))/length(pvalues)) ==
     TRUE)
     if (sum(kmax) > 0) {
     kmax <- max(kmax)
     sigPvalues <- pvalues.sorted[1:kmax]
     multAlpha <- pvalues.sorted[kmax]
     sigTests <- which(is.element(pvalues, sigPvalues))
     }
     }
     else if (method == "csD") {
     alphaGrid <- seq(0, alpha, 0.001)
     csDMat <- matrix(NA, ncol = length(alphaGrid), nrow = 2)
     for (i in 1:length(alphaGrid)) {
     csDMat[1, i] <- sum(pvalues <= alphaGrid[i])
     csDMat[2, i] <- alphaGrid[i] * length(pvalues)
     }
     csD <- csDMat[1, ] - csDMat[2, ]
     multAlpha <- alphaGrid[which(csD == max(csD))]
     sigTests <- which(pvalues <= multAlpha)
     sigPvalues <- pvalues[pvalues <= multAlpha]
     }
     else if (method == "csR") {
     alphaGrid <- seq(0.001, alpha, 0.001)
     csRMat <- matrix(NA, ncol = length(alphaGrid), nrow = 2)
     for (i in 1:length(alphaGrid)) {
     csRMat[1, i] <- sum(pvalues <= alphaGrid[i])
     csRMat[2, i] <- alphaGrid[i] * length(pvalues)
     }
     csR <- csRMat[1, ]/csRMat[2, ]
     multAlpha <- alphaGrid[which(csR == max(csR))]
     sigTests <- which(pvalues <= min(multAlpha))
     sigPvalues <- pvalues[pvalues <= multAlpha]
     }
     result <- list(sigTests = sigTests, sigPvalues = sigPvalues,
     pvalues = pvalues, method = method, alpha = alpha,
     multAlpha = multAlpha)
     result
     }
     getSigTests.WY <- function(obs, pm, alpha, alternative, pvalues) {
     Ntests <- length(obs)
     if (alternative == "smaller") {
     obs.sorted <- sort(obs, decreasing = FALSE)
     pm.sorted <- pm[, order(obs, decreasing = FALSE)]
     multAlpha <- c()
     for (i in 1:(Ntests - 1)) {
     temp <- apply(pm.sorted[, (i:Ntests)], 1, min)
     multAlpha[i] <- sum(temp < obs.sorted[i])/nrow(pm)
     }
     multAlpha[Ntests] <- sum(pm.sorted[, Ntests] < obs.sorted[Ntests])/nrow(pm)
     multAlpha <- cummax(multAlpha)[rank(obs)]
     }
     else {
     obs.sorted <- sort(obs, decreasing = TRUE)
     pm.sorted <- pm[, order(obs, decreasing = TRUE)]
     multAlpha <- c()
     for (i in 1:(Ntests - 1)) {
     temp <- apply(pm.sorted[, (i:Ntests)], 1, max)
     multAlpha[i] <- sum(temp > obs.sorted[i])/nrow(pm)
     }
     multAlpha[Ntests] <- sum(pm.sorted[, Ntests] > obs.sorted[Ntests])/nrow(pm)
     multAlpha <- cummax(multAlpha)[rank(-obs)]
     }
     sigTests <- which(multAlpha <= alpha)
     sigPvalues <- pvalues[multAlpha <= alpha]
     names(multAlpha) <- colnames(pvalues)
     result <- list(sigTests = sigTests, sigPvalues = sigPvalues,
     pvalues = pvalues, method = method, alpha = alpha,
     multAlpha = multAlpha)
     result
     }
     if (method == "maxT") {
     if (class(pvalues) != "gmw")
     stop("The pvalues object has to be of class gmw, please put here the outpt of the function gmw.")
     if (attr(pvalues, "keepPM") != TRUE)
     stop("For the Westfall & Young approach the permutation matrix has to be available, please choose the option 'keepPM=TRUE' in the gmw call.")
     alternative <- attr(pvalues, "alternative")
     if (is.matrix(pvalues$p.values) && nrow(pvalues$p.values) ==
     1)
     isVector <- TRUE
     if (!isVector) {
     result <- list()
     for (i in 1:nrow(pvalues$p.values)) {
     result[[i]] <- getSigTests.WY(pvalues$obsValue[[i]],
     pvalues$nullDist[[i]], alpha = alpha, alternative = alternative,
     pvalues = t(as.matrix(pvalues$p.values[i, ])))
     }
     result$inputN <- nrow(pvalues$p.values)
     }
     else {
     result <- getSigTests.WY(pvalues$obsValue[[1]], pvalues$nullDist[[1]],
     alpha = alpha, alternative = alternative, pvalues = pvalues$p.values)
     result$inputN <- 1
     }
     }
     else {
     if (class(pvalues) != "gmw") {
     temp <- pvalues
     pvalues <- list()
     pvalues$p.values <- temp
     }
     if (is.matrix(pvalues$p.values) && nrow(pvalues$p.values) ==
     1)
     isVector <- TRUE
     if (!isVector) {
     result <- list()
     for (i in 1:nrow(pvalues$p.values)) {
     result[[i]] <- getSigTests.internal(pvalues$p.values[i,
     ], alpha = alpha, method)
     }
     result$inputN <- nrow(pvalues$p.values)
     }
     else {
     result <- getSigTests.internal(pvalues$p.values,
     alpha, method)
     result$inputN <- 1
     }
     }
     class(result) <- "re"
     result
    }
    <bytecode: 0x33a5b48>
    <environment: namespace:gMWT>
     --- function search by body ---
    Function getSigTests in namespace gMWT has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(pvalues) != "gmw") { : the condition has length > 1
    Calls: getSigTests
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.1
Check: compiled code
Result: NOTE
    File ‘gMWT/libs/gMWT.so’:
     Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols’
    
    It is good practice to register native routines and to disable symbol
    search.
    
    See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual.
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc