CRAN Package Check Results for Package rags2ridges

Last updated on 2019-12-14 22:49:05 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 2.2.1 58.19 197.18 255.37 ERROR
r-devel-linux-x86_64-debian-gcc 2.2.1 45.91 154.78 200.69 OK
r-devel-linux-x86_64-fedora-clang 2.2.1 326.64 NOTE
r-devel-linux-x86_64-fedora-gcc 2.2.1 313.43 NOTE
r-devel-windows-ix86+x86_64 2.2.1 111.00 448.00 559.00 OK
r-devel-windows-ix86+x86_64-gcc8 2.2.1 160.00 468.00 628.00 OK
r-patched-linux-x86_64 2.2.1 49.21 181.97 231.18 OK
r-patched-solaris-x86 2.2.1 376.10 NOTE
r-release-linux-x86_64 2.2.1 49.79 183.39 233.18 OK
r-release-windows-ix86+x86_64 2.2.1 99.00 306.00 405.00 OK
r-release-osx-x86_64 2.2.1 NOTE
r-oldrel-windows-ix86+x86_64 2.2.1 74.00 268.00 342.00 OK
r-oldrel-osx-x86_64 2.2.1 NOTE

Check Details

Version: 2.2.1
Check: examples
Result: ERROR
    Running examples in 'rags2ridges-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: optPenaltyPchordal
    > ### Title: Automatic search for penalty parameter of ridge precision
    > ### estimator with known chordal support
    > ### Aliases: optPenaltyPchordal
    >
    > ### ** Examples
    >
    > # generate data
    > p <- 8
    > n <- 100
    > set.seed(333)
    > Y <- matrix(rnorm(n*p), nrow = n, ncol = p)
    >
    > # define zero structure
    > S <- covML(Y)
    > S[1:3, 6:8] <- 0
    > S[6:8, 1:3] <- 0
    > zeros <- which(S==0, arr.ind=TRUE)
    >
    > # obtain (triangulated) support info
    > supportP <- support4ridgeP(nNodes=p, zeros=zeros)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     at /tmp/Rtmp2wCAqW/R.INSTALL30e13e2fa789/rags2ridges/R/rags2ridgesVariants.r#130:
     --- package (from environment) ---
    rags2ridges
     --- call from context ---
    support4ridgeP(nNodes = p, zeros = zeros)
     --- call from argument ---
    if (!is.null(zeros) & as.character(class(zeros)) != "matrix") {
     stop("Input (zeros) is of wrong class.")
    }
     --- R stacktrace ---
    where 1: support4ridgeP(nNodes = p, zeros = zeros)
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function(adjMat=NULL,
     nNodes=NULL,
     zeros=NULL,
     verbose=FALSE){
    
     ########################################################################
     #
     # DESCRIPTION:
     # The zero pattern of an adjancency matrix is converted into its
     # junction tree (as a list of its cliques and separators). When a
     # graph with nondecomposable support is provided, it is triangulated.
     #
     # ARGUMENTS:
     # -> adjMat : Adjacency matrix of an undirected graph.
     # -> nNodes : Number of nodes of the graph.
     # -> zeros : Matrix with indices of entries of the adjacency
     # matrix that are constrained to zero. The matrix
     # comprises two columns, each row corresponding to
     # an entry of the adjacency matrix. The first
     # column contains the row indices and the second
     # the column indices. The specified graph should be
     # undirected and decomposable. If not, it is
     # symmetrized and triangulated.
     # -> verbose : Logical indicating whether progress should be reported.
     #
     #
     # DEPENDENCIES:
     # require("igraph") # functions from package : graph.adjancency,
     # igraph.to.graphNEL
     # require("gRbase") # functions from package : triangulate
     # require("RGBL") # functions from package : is.triangulated
     # require("graph") # functions from package : 'graphAM'-class
     #
     ########################################################################
    
     # iput checks
     if (is.null(adjMat) & is.null(nNodes) & is.null(zeros)){
     stop("Support not sufficiently specified.")
     }
     if (is.null(adjMat) & is.null(nNodes)){
     stop("Support not sufficiently specified.")
     }
     if (is.null(adjMat) & is.null(zeros)){
     stop("Support not sufficiently specified.")
     }
     if (!is.null(adjMat)){
     if (!is.matrix(adjMat)){
     stop("adjMat should be a matrix.")
     }
     if (nrow(adjMat) != ncol(adjMat)){
     stop("adjMat should be square matrix.")
     }
     if (!all(sort(unique(as.numeric(adjMat))) == c(0,1))){
     stop("Elements of adjMat ill-specified.")
     }
     if (!isSymmetric(adjMat)){
     stop("adjMat does not correspond to an undirect graph.")
     }
     if (!all(diag(adjMat) == 0)){
     stop("adjMat contains nonzero diagonal element.")
     }
     }
     if (!is.null(nNodes)){
     if (class(nNodes) != "numeric" & class(nNodes) != "integer"){
     stop("Input (nNodes) is of wrong class")
     }
     if (length(nNodes) != 1){
     stop("Input (nNodes) must be a scalar")
     }
     if (!.is.int(nNodes)){
     stop("Input (nNodes) should be an integer")
     }
     if (nNodes <= 0){
     stop("Input (nNodes) must be strictly positive")
     }
     }
     if (!is.null(zeros)){
     if (!is.null(zeros) & as.character(class(zeros)) != "matrix"){
     stop("Input (zeros) is of wrong class.")
     }
     if (!is.null(zeros)){
     if(ncol(zeros) != 2){
     stop("Wrong dimensions of the (zeros).")
     }
     }
     if (!is.null(zeros)){
     zeros <- zeros[order(zeros[,2], zeros[,1]),]
     }
     }
     if (as.character(class(verbose)) != "logical"){
     stop("Input (verbose) is of wrong class.")
     }
    
     # convert zero pattern into adjacency matrix
     if (!is.null(zeros) & !is.null(nNodes) & is.null(adjMat)){
     adjMat <- matrix(1, nNodes, nNodes)
     adjMat[zeros] <- 0
     adjMat[cbind(zeros[,2], zeros[,1])] <- 0
     diag(adjMat) <- 0
     }
    
     # convert adjacency into graphNel object
     G <- igraph::igraph.to.graphNEL(igraph::graph.adjacency(adjMat,
     mode="undirected"))
    
     # is graph complete?
     is.complete(G)
    
     # check whether a chordal support has been provided
     addedEdges <- matrix(nrow=0, ncol=2)
     if (!RBGL::is.triangulated(G)){
     if(verbose){
     cat("-> provided zero pattern not chordal : support is triangulated,", "\n")
     }
     nEdgesOld <- numEdges(G)
     G <- gRbase::triangulate(G)
     nEdgesNew <- numEdges(G)
     addedEdges <- which(as(G, "graphAM")@adjMat - adjMat == 1,
     arr.ind=TRUE)
     adjMat <- as(G, "graphAM")@adjMat
     diag(adjMat) <- 1
     zeros <- which(adjMat == 0, arr.ind=TRUE)
     if(verbose){
     cat(paste("-> ",
     nEdgesNew - nEdgesOld,
     " extra nonzeros", sep=""), "\n")
     }
     }
     if (is.null(zeros)){
     diag(adjMat) <- 1
     zeros <- which(adjMat == 0, arr.ind=TRUE)
     }
    
     # decompose in cliques and separators
     decomp <- gRbase::rip(G)
     Cliques <- decomp$cliques
     Separators <- decomp$separators
    
     # convert index vectors from character to integer
     for (k in 1:length(Cliques)){
     Cliques[[k]] <- as.integer(Cliques[[k]])
     }
     for (k in 1:length(Separators)){
     Separators[[k]] <- as.integer(Separators[[k]])
     }
    
     return(list(zeros=zeros,
     cliques=Cliques,
     separators=Separators,
     addedEdges=addedEdges))
    }
    <bytecode: 0x10629578>
    <environment: namespace:rags2ridges>
     --- function search by body ---
    Function support4ridgeP in namespace rags2ridges has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (!is.null(zeros) & as.character(class(zeros)) != "matrix") { :
     the condition has length > 1
    Calls: support4ridgeP
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 2.2.1
Check: installed package size
Result: NOTE
     installed size is 5.3Mb
     sub-directories of 1Mb or more:
     libs 4.1Mb
Flavors: r-devel-linux-x86_64-fedora-clang, r-release-osx-x86_64, r-oldrel-osx-x86_64

Version: 2.2.1
Check: dependencies in R code
Result: NOTE
    Namespace in Imports field not imported from: ‘Rcpp’
     All declared Imports should be used.
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-solaris-x86, r-release-osx-x86_64, r-oldrel-osx-x86_64