CRAN Package Check Results for Package simcausal

Last updated on 2020-02-19 10:49:10 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.5.5 9.35 196.98 206.33 ERROR
r-devel-linux-x86_64-debian-gcc 0.5.5 8.92 153.23 162.15 ERROR
r-devel-linux-x86_64-fedora-clang 0.5.5 229.13 ERROR
r-devel-linux-x86_64-fedora-gcc 0.5.5 224.28 ERROR
r-devel-windows-ix86+x86_64 0.5.5 15.00 77.00 92.00 OK --no-examples --no-tests --no-vignettes
r-devel-windows-ix86+x86_64-gcc8 0.5.5 20.00 56.00 76.00 OK --no-examples --no-tests --no-vignettes
r-patched-linux-x86_64 0.5.5 9.21 275.60 284.81 OK
r-patched-solaris-x86 0.5.5 463.60 OK
r-release-linux-x86_64 0.5.5 8.29 269.44 277.73 OK
r-release-windows-ix86+x86_64 0.5.5 12.00 63.00 75.00 OK --no-examples --no-tests --no-vignettes
r-release-osx-x86_64 0.5.5 OK
r-oldrel-windows-ix86+x86_64 0.5.5 9.00 58.00 67.00 OK --no-examples --no-tests --no-vignettes
r-oldrel-osx-x86_64 0.5.5 OK

Check Details

Version: 0.5.5
Check: examples
Result: ERROR
    Running examples in 'simcausal-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: network
    > ### Title: Define a Network Generator
    > ### Aliases: network
    >
    > ### ** Examples
    >
    > #--------------------------------------------------------------------------------------------------
    > # EXAMPLE 1. USING igraph R PACKAGE TO SIMULATE NETWORKS
    > #--------------------------------------------------------------------------------------------------
    >
    > #--------------------------------------------------------------------------------------------------
    > # Example of a network sampler, will be provided as "netfun" argument to network(, netfun=);
    > # Generates a random graph according to the G(n,m) Erdos-Renyi model using the igraph package;
    > # Returns (n,Kmax) matrix of net IDs (friends) by row;
    > # Row i contains the IDs (row numbers) of i's friends;
    > # i's friends are assumed connected to i and can influence i in equations defined by node())
    > # When i has less than Kmax friends, the remaining i row entries are filled with NAs;
    > # Argument m_pn: > 0
    > # a total number of edges in the network as a fraction (or multiplier) of n (sample size)
    > #--------------------------------------------------------------------------------------------------
    > gen.ER <- function(n, m_pn, ...) {
    + m <- as.integer(m_pn*n)
    + if (n<=10) m <- 20
    + igraph.ER <- igraph::sample_gnm(n = n, m = m, directed = TRUE)
    + sparse_AdjMat <- igraph.to.sparseAdjMat(igraph.ER)
    + NetInd_out <- sparseAdjMat.to.NetInd(sparse_AdjMat)
    + return(NetInd_out$NetInd_k)
    + }
    >
    > D <- DAG.empty()
    > # Sample ER model network using igraph::sample_gnm with m_pn argument:
    > D <- D + network("ER.net", netfun = "gen.ER", m_pn = 50)
    > # W1 - categorical (6 categories, 1-6):
    > D <- D +
    + node("W1", distr = "rcat.b1",
    + probs = c(0.0494, 0.1823, 0.2806, 0.2680, 0.1651, 0.0546)) +
    + # W2 - binary infection status, positively correlated with W1:
    + node("W2", distr = "rbern", prob = plogis(-0.2 + W1/3)) +
    + # W3 - binary confounder:
    + node("W3", distr = "rbern", prob = 0.6)
    > # A[i] is a function W1[i] and the total of i's friends values W1, W2 and W3:
    > D <- D + node("A", distr = "rbern",
    + prob = plogis(2 + -0.5 * W1 +
    + -0.1 * sum(W1[[1:Kmax]]) +
    + -0.4 * sum(W2[[1:Kmax]]) +
    + -0.7 * sum(W3[[1:Kmax]])),
    + replaceNAw0 = TRUE)
    > # Y[i] is a function of netW3 (friends of i W3 values) and the total N of i's friends
    > # who are infected AND untreated:
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 2 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    > # Can add N untreated friends to the above outcome Y equation: sum(1 - A[[1:Kmax]]):
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 1.5 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]]) +
    + 0.25 * sum(1 - A[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    existing node Y was modified
    > # Can add N infected friends at baseline to the above outcome Y equation: sum(W2[[1:Kmax]]):
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 1 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]]) +
    + 0.25 * sum(1 - A[[1:Kmax]]) +
    + 0.25 * sum(W2[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    existing node Y was modified
    > Dset <- set.DAG(D, n.test = 100)
    ...automatically assigning order attribute to some nodes...
    node ER.net, order:1
    node W1, order:2
    node W2, order:3
    node W3, order:4
    node A, order:5
    node Y, order:6
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    simcausal
     --- call from context ---
    standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
    if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
    } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
    } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
    } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
    }
     --- R stacktrace ---
    where 1: standardize_param(newNodeParams$dist_params[[idx]])
    where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
    where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
    where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
    where 10: set.DAG(D, n.test = 100)
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (distparam)
    {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
    }
    <bytecode: 0x27a85d8>
    <environment: 0xbd85228>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
    Error in set.DAG(D, n.test = 100) :
    ...attempt to simulate data from DAG failed...
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 0.5.5
Check: tests
Result: ERROR
     Running 'test-all.R' [134s/152s]
    Running the tests in 'tests/test-all.R' failed.
    Complete output:
     > ## unit tests will not be done if RUnit is not available
     > # setwd("..")
     > # getwd()
     > # library(RUnit)
     > if(require("RUnit", quietly=TRUE)) {
     + ## --- Setup ---
     +
     + pkg <- "simcausal" # <-- Tested 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(), "..", "inst", "unitTests")
     + } else {
     + ## Path to unit tests for R CMD check
     + ## PKG.Rcheck/tests/../PKG/unitTests
     + # path <- system.file(package=pkg, "RUnit")
     +
     + # REPLACED WITH:
     + path <- file.path(getwd(), "RUnit")
     + }
     +
     + 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
     + test.suite <- defineTestSuite(name=paste(pkg, "unit testing"),
     + # dirs="./RUnit",
     + dirs=path,
     + testFileRegexp = "^RUnit_tests_+",
     + testFuncRegexp = "^test.+",
     + rngKind = "Marsaglia-Multicarry",
     + rngNormalKind = "Kinderman-Ramage")
     + ## Run
     + tests <- runTestSuite(test.suite)
     +
     + ## Default report name
     + pathReport <- file.path(path, "report")
     +
     + ## Report to stdout and text files
     + cat("------------------- UNIT TEST SUMMARY ---------------------\n\n")
     + printTextProtocol(tests, showDetails=FALSE)
     + printTextProtocol(tests, showDetails=FALSE,
     + fileName=paste0(pathReport, "Summary.txt"))
     + printTextProtocol(tests, showDetails=TRUE,
     + fileName=paste0(pathReport, ".txt"))
     + ## Report to HTML file
     + printHTMLProtocol(tests, fileName=paste0(pathReport, ".html"))
     +
     + ## 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] "simcausal"
    
     $getwd
     [1] "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/simcausal.Rcheck/tests"
    
     $pathToUnitTests
     [1] "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/simcausal.Rcheck/tests/RUnit"
    
    
    
     Executing test function test.EFUeval ... ...automatically assigning order attribute to some nodes...
     node C.time_0, order:1
     node Y_0, order:2
     node D_0, order:3
     node C.time_1, order:4
     node Y_1, order:5
     node D_1, order:6
     node C.time_2, order:7
     node Y_2, order:8
     node D_2, order:9
     node C.time_3, order:10
     node Y_3, order:11
     node D_3, order:12
     node C.time_4, order:13
     node Y_4, order:14
     node D_4, order:15
     node C.time_5, order:16
     node Y_5, order:17
     node D_5, order:18
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node C.time_0, order:1
     node Y_0, order:2
     node D_0, order:3
     node C.time_1, order:4
     node Y_1, order:5
     node D_1, order:6
     node C.time_2, order:7
     node Y_2, order:8
     node D_2, order:9
     node C.time_3, order:10
     node Y_3, order:11
     node D_3, order:12
     node C.time_4, order:13
     node Y_4, order:14
     node D_4, order:15
     node C.time_5, order:16
     node Y_5, order:17
     node D_5, order:18
     using the following vertex attributes:
     NAdarkbluenone70.50
     using the following edge attributes:
     black0.210.30.2
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.Nsamp.n.test ... ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     done successfully.
    
    
    
     Executing test function test.bugfixes ... ...automatically assigning order attribute to some nodes...
     node const, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     node Y, order:6
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node L2_1, order:5
     node L2_2, order:6
     node L2_3, order:7
     node L2_4, order:8
     node L2_5, order:9
     node L2_6, order:10
     node L2_7, order:11
     node L2_8, order:12
     node L2_9, order:13
     node L2_10, order:14
     node L2_11, order:15
     node L2_12, order:16
     node L2_13, order:17
     node L2_14, order:18
     node L2_15, order:19
     node L2_16, order:20
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node L2_1, order:3
     node L1_1, order:4
     node L2_2, order:5
     node L1_2, order:6
     node L2_3, order:7
     node L1_3, order:8
     node L2_4, order:9
     node L1_4, order:10
     node L2_5, order:11
     node L1_5, order:12
     node L2_6, order:13
     node L1_6, order:14
     node L2_7, order:15
     node L1_7, order:16
     node L2_8, order:17
     node L1_8, order:18
     node L2_9, order:19
     node L1_9, order:20
     node L2_10, order:21
     node L1_10, order:22
     node L2_11, order:23
     node L1_11, order:24
     node L2_12, order:25
     node L1_12, order:26
     node L2_13, order:27
     node L1_13, order:28
     node L2_14, order:29
     node L1_14, order:30
     node L2_15, order:31
     node L1_15, order:32
     node L2_16, order:33
     node L1_16, order:34
     Error in add.nodes(DAG = obj1, nodes = obj2) :
     DAG object is locked: nodes in this DAG cannot be modified or added after set.DAG()
     In addition: Warning messages:
     1: In add.nodes(DAG = obj1, nodes = obj2) :
     existing non-time-varying node L2 was overwritten with a time-varying node
     2: In add.nodes(DAG = obj1, nodes = obj2) :
     existing non-time-varying node L2 was overwritten with a time-varying node
     3: In set.DAG(D) :
     trying to lock an empty DAG, add nodes before calling set.DAG()
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0x2632f18>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.386 0.171 1.7
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.condrcat.factor ... ...automatically assigning order attribute to some nodes...
     node W, order:1
     node Cat3, order:2
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0xc0d1f70>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.264 0.003 0.31
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.distr ... All custom distributions defined in SimCausal:
    
     [1] "rbern" "rcat.b0" "rcat.b1" "rcat.factor"
     [5] "rcategor" "rcategor.int" "rconst" "rdistr.template"
     Error in rdistr.template(n = 100, arg1 = rep(0.5, 100), arg2 = rep(0.3, :
     inputs arguments should all have the same length
     done successfully.
    
    
    
     Executing test function test.experimental_parsingMSMs ... Error in simcausal:::parse.MSMform(msm.form = msm.form_3_error, t_vec = t_vec, :
     unable to map some of S() expressions in MSM formula, check that all of the summary measure expressions have been previously defined
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     for df_full in long format new summary measures cannot be calculated, using whatever summary measures already exist in df_full
     for df_full in long format outcome is pooled over the same t vector as defined in the first MSM that generated the long format data, changing pooling t requires re-generating the full data
     assuming the data is based on the following map of MSM terms to variable names
     S_exprs_vec XMSMterms
     1 A1[max(0, t - 2)] XMSMterm.4
     MSM: fitting glm to full data
     for df_full in long format new summary measures cannot be calculated, using whatever summary measures already exist in df_full
     for df_full in long format outcome is pooled over the same t vector as defined in the first MSM that generated the long format data, changing pooling t requires re-generating the full data
     assuming the data is based on the following map of MSM terms to variable names
     S_exprs_vec XMSMterms
     1 A1[max(0, t - 2)] XMSMterm.4
     2 A1[max(0, t - 1)] XMSMterm.1
     MSM: fitting glm to full data
     Error in parse.MSMform(msm.form = form, t_vec = t_vec, old.DAG = DAG, :
     unable to map some of S() expressions in MSM formula, check that all of the summary measure expressions have been previously defined
     done successfully.
    
    
    
     Executing test function test.faster_tolongdata ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.latent ... ...automatically assigning order attribute to some nodes...
     node I, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     node U.Y, order:6
     node Y, order:7
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D, latent.v = c("I", "U.Y"))
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0xf2382e8>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.027 0 0.026
     Error in set.DAG(D, latent.v = c("I", "U.Y")) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.longparse ... ...automatically assigning order attribute to some nodes...
     node group, order:1
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D2)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0x90de640>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.018 0 0.017
     Error in set.DAG(D2) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.node ... ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     node L2, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     existing node W1 was modified
     existing node W2 was modified
     existing node W3 was modified
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L1_0, order:1
     node L2_0, order:2
     Error in add.nodes(DAG = obj1, nodes = obj2) :
     cannot define nodes with missing t after nodes with t non-missing were already defined
     In addition: Warning message:
     In rcat.b1(n = n, probs = probs) :
     some categorical probabilities add up to more than 1, normalizing to add to 1
     existing node L1_3 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     ...automatically assigning order attribute to some nodes...
     node L1_0, order:1
     node L2_0, order:2
     node L1_1, order:3
     node L2_1, order:4
     node L1_2, order:5
     node L2_2, order:6
     node L1_3, order:7
     node L2_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L1_5, order:11
     node L2_5, order:12
     simulating observed dataset from the DAG object
     existing node L1_2 was modified
     existing node L1_3 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     ...automatically assigning order attribute to some nodes...
     node L3_0, order:1
     node L3_1, order:2
     node L1_2, order:3
     node L2_2, order:4
     node L3_2, order:5
     node L1_3, order:6
     node L2_3, order:7
     node L3_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L3_4, order:11
     node L1_5, order:12
     node L2_5, order:13
     node L3_5, order:14
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L3_0, order:1
     node L3_1, order:2
     node L1_2, order:3
     node L2_2, order:4
     node L3_2, order:5
     node L1_3, order:6
     node L2_3, order:7
     node L3_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L3_4, order:11
     node L1_5, order:12
     node L2_5, order:13
     node L3_5, order:14
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node A2_0, order:4
     node Y_0, order:5
     node L2_1, order:6
     node A1_1, order:7
     node A2_1, order:8
     node Y_1, order:9
     node L2_2, order:10
     node A1_2, order:11
     node A2_2, order:12
     node Y_2, order:13
     node L2_3, order:14
     node A1_3, order:15
     node A2_3, order:16
     node Y_3, order:17
     node L2_4, order:18
     node A1_4, order:19
     node A2_4, order:20
     node Y_4, order:21
     node L2_5, order:22
     node A1_5, order:23
     node A2_5, order:24
     node Y_5, order:25
     node L2_6, order:26
     node A1_6, order:27
     node A2_6, order:28
     node Y_6, order:29
     node L2_7, order:30
     node A1_7, order:31
     node A2_7, order:32
     node Y_7, order:33
     node L2_8, order:34
     node A1_8, order:35
     node A2_8, order:36
     node Y_8, order:37
     node L2_9, order:38
     node A1_9, order:39
     node A2_9, order:40
     node Y_9, order:41
     node L2_10, order:42
     node A1_10, order:43
     node A2_10, order:44
     node Y_10, order:45
     node L2_11, order:46
     node A1_11, order:47
     node A2_11, order:48
     node Y_11, order:49
     node L2_12, order:50
     node A1_12, order:51
     node A2_12, order:52
     node Y_12, order:53
     node L2_13, order:54
     node A1_13, order:55
     node A2_13, order:56
     node Y_13, order:57
     node L2_14, order:58
     node A1_14, order:59
     node A2_14, order:60
     node Y_14, order:61
     node L2_15, order:62
     node A1_15, order:63
     node A2_15, order:64
     node Y_15, order:65
     node L2_16, order:66
     node A1_16, order:67
     node A2_16, order:68
     node Y_16, order:69
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.noexistdistr ... ...automatically assigning order attribute to some nodes...
     node W1, order:1
     rbinom2: note this distribution could not be located in package namespace, simulating from user-defined distribution found under the same name
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0x56aeb50>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.012 0.004 0.017
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.plotting ... ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node A2_0, order:4
     node Y_0, order:5
     node L2_1, order:6
     node A1_1, order:7
     node A2_1, order:8
     node Y_1, order:9
     node L2_2, order:10
     node A1_2, order:11
     node A2_2, order:12
     node Y_2, order:13
     node L2_3, order:14
     node A1_3, order:15
     node A2_3, order:16
     node Y_3, order:17
     node L2_4, order:18
     node A1_4, order:19
     node A2_4, order:20
     node Y_4, order:21
     node L2_5, order:22
     node A1_5, order:23
     node A2_5, order:24
     node Y_5, order:25
     node L2_6, order:26
     node A1_6, order:27
     node A2_6, order:28
     node Y_6, order:29
     node L2_7, order:30
     node A1_7, order:31
     node A2_7, order:32
     node Y_7, order:33
     node L2_8, order:34
     node A1_8, order:35
     node A2_8, order:36
     node Y_8, order:37
     node L2_9, order:38
     node A1_9, order:39
     node A2_9, order:40
     node Y_9, order:41
     node L2_10, order:42
     node A1_10, order:43
     node A2_10, order:44
     node Y_10, order:45
     node L2_11, order:46
     node A1_11, order:47
     node A2_11, order:48
     node Y_11, order:49
     node L2_12, order:50
     node A1_12, order:51
     node A2_12, order:52
     node Y_12, order:53
     node L2_13, order:54
     node A1_13, order:55
     node A2_13, order:56
     node Y_13, order:57
     node L2_14, order:58
     node A1_14, order:59
     node A2_14, order:60
     node Y_14, order:61
     node L2_15, order:62
     node A1_15, order:63
     node A2_15, order:64
     node Y_15, order:65
     node L2_16, order:66
     node A1_16, order:67
     node A2_16, order:68
     node Y_16, order:69
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG1 ... simulating observed dataset from the DAG object
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG2_errors ... Error in node("A_2", distr = "rbern", prob = 0.5, order = 1) :
     node names with underscore character '_' are not allowed
     Error in L2[0] : undefined time-dependent variable(s): L2_0
     Error : error while evaluating node L2_0 formula:
     ifelse(L2[0] == 1, 0.5, 0.1).
     Check syntax specification.
     Error in set.DAG(c(L2_0, L1_0)) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node , order:1
     node , order:2
     node , order:3
     node , order:4
     Error in strsplit(cur.node$name, "_") : non-character argument
     Error in set.DAG(testDAG_2_err1a) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node , order:1
     node , order:2
     node , order:3
     node , order:4
     node , order:5
     Error in set.DAG(testDAG_2_err1b) :
     All DAG nodes must have unique name attributes
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG2b_newactions ... ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     node A, order:4
     node Y, order:5
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     node A, order:4
     node Y, order:5
     ...automatically assigning order attribute to some nodes...
     node W1_0, order:1
     node W2_0, order:2
     node W3_0, order:3
     node A_0, order:4
     node Y_0, order:5
     node W1_1, order:6
     node W2_1, order:7
     node W3_1, order:8
     node A_1, order:9
     node Y_1, order:10
     ...automatically assigning order attribute to some nodes...
     node W1_0, order:1
     node W2_0, order:2
     node W3_0, order:3
     node A_0, order:4
     node Y_0, order:5
     node W1_1, order:6
     node W2_1, order:7
     node W3_1, order:8
     node A_1, order:9
     node Y_1, order:10
     simulating observed dataset from the DAG object
     using the following vertex attributes:
     NAdarkbluenone100.50
     using the following edge attributes:
     black0.210.60.5
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     Error : n is not a count (a single positive integer)
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     Error in getactions(DAG, actions) :
     Couldn't locate action: A4 , first define action by adding it to the DAG object with DAG+action
     In addition: There were 13 warnings (use warnings() to see them)
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     user system elapsed
     0.526 0.000 0.616
     simulating observed dataset from the DAG object
     user system elapsed
     0.567 0.000 0.654
     simulating observed dataset from the DAG object
     user system elapsed
     0.576 0.011 0.609
     Error in X_dat_th0[[2]] : subscript out of bounds
     In addition: There were 11 warnings (use warnings() to see them)
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     Error in eval.target(D, n = 500, actions = "A1_th1", rndseed = 123) :
     some of the actions in param argument could not be found in the simulated full data
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG3_wlong ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG_informcens ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_general ... Error in set.DAG(testDAG_listobj1) : DAG must be a list
     In addition: Warning messages:
     1: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type == :
     prediction from a rank-deficient fit may be misleading
     2: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type == :
     prediction from a rank-deficient fit may be misleading
     Error in set.DAG(testDAG_listobj2) :
     each of DAG items must be a list specifying DAG node(s)
     ...automatically assigning order attribute to some nodes...
     node nm, order:1
     node nm, order:2
     node nm, order:3
     Error : !is.null(user.env) is not TRUE
     Error in set.DAG(testDAG_names1) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node nm, order:2
     node nm, order:3
     Error : !is.null(user.env) is not TRUE
     Error in set.DAG(testDAG_names2) :
     ...attempt to simulate data from DAG failed...
     Error in set.DAG(testDAG_dist) :
     All DAG nodes must have unique name attributes
     done successfully.
    
    
    
     Executing test function test.substitute ... ...automatically assigning order attribute to some nodes...
     node I, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0x11831650>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.021 0 0.021
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.t.error ... Error in add.nodes(DAG = obj1, nodes = obj2) :
     cannot define nodes with missing t after nodes with t non-missing were already defined
     done successfully.
    
    
    
     Executing test function test.tswitch_2MSMs ... [1] 0
     [1] "abar"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 3
     [1] "abar"
     [1] 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 6
     [1] "abar"
     [1] 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1
     [1] 10
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
     [1] 13
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
     [1] 17
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "tswitch_i"
     [1] 0
     [1] "meanExposureVec"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "tswitch_i"
     [1] 3
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.250 0.400 0.500 0.571 0.625 0.667 0.700 0.727 0.750
     [13] 0.769 0.786 0.800 0.812 0.824
     [1] "tswitch_i"
     [1] 6
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.143 0.250 0.333 0.400 0.455 0.500
     [13] 0.538 0.571 0.600 0.625 0.647
     [1] "tswitch_i"
     [1] 10
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.091 0.167
     [13] 0.231 0.286 0.333 0.375 0.412
     [1] "tswitch_i"
     [1] 13
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
     [13] 0.000 0.071 0.133 0.188 0.235
     [1] "tswitch_i"
     [1] 17
     [1] "meanExposureVec"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] 0
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 5
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.2857143
     [8] 0.3750000 0.4444444 0.5000000 0.5454545 0.5833333 0.6153846 0.6428571
     [15] 0.6666667 0.6875000 0.7058824
     [1] 10
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] 17
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 200 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.2857143
     [8] 0.3750000 0.4444444 0.5000000 0.5454545 0.5833333 0.6153846 0.6428571
     [15] 0.6666667 0.6875000 0.7058824
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     done successfully.
    
    
    
     Executing test function test.long.wide.simobs ... done successfully.
    
    
    
     Executing test function test.networkgen1 ... [1] "automatic Kmax: "
     [1] 3
     [1] "NetInd_k"
     [,1] [,2] [,3]
     [1,] 6 7 NA
     [2,] 1 3 NA
     [3,] 4 NA NA
     [4,] 5 NA NA
     [5,] NA NA NA
     [6,] NA NA NA
     existing node Net.sample was modified
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 3
     [1] "NetInd_k"
     [,1] [,2] [,3]
     [1,] 8 NA NA
     [2,] 1 NA NA
     [3,] 2 NA NA
     [4,] 5 NA NA
     [5,] NA NA NA
     [6,] 8 10 NA
     existing node Net.sample was modified
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 3
     [1] "NetInd_k"
     [,1] [,2] [,3]
     [1,] NA NA NA
     [2,] NA NA NA
     [3,] 8 NA NA
     [4,] 6 9 NA
     [5,] 1 6 NA
     [6,] NA NA NA
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 2
     [1] "NetInd_k"
     [,1] [,2]
     [1,] 8 NA
     [2,] NA NA
     [3,] 5 10
     [4,] 7 NA
     [5,] NA NA
     [6,] 1 2
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0x1381c190>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 2.209 0.02 2.73
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.networkgen2 ... ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0x13c98e10>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.026 0 0.027
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.networkgen_time ... Error in W2[[0]] : variable W2 doesn't exist
     Error : error while evaluating node F.W2_0 formula:
     W2[[0]].
     Check syntax specification.
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error in F.W1[0:1][[0]] :
     ...network indexing variable evaluated to more than one column ...
     Error : error while evaluating node F.W1_2 formula:
     F.W1[0:1][[0]].
     Check syntax specification.
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error : Undefined variable: F.A
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.tKmaxnet ... Error in eval.nodeform.full(expr_call = expr_call, expr_str = expr_str, :
     reference A[...] at node B is not allowed; node A was defined as time-invariant
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     Error : Undefined variable: xyz
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     Error in eval.nodeform.full(expr_call = expr_call, expr_str = expr_str, :
     reference A[...] at node B is not allowed; node A was defined as time-invariant
     In addition: Warning message:
     In FUN(X[[i]], ...) : the argument inside [...] cannot be parsed: A[rnorm]
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.MV ... Loading required package: mvtnorm
     ...automatically assigning order attribute to some nodes...
     node X1.X2.X3, order:1
     node Y1.Y2, order:2
     node A, order:3
     Loading required package: copula
    
     Attaching package: 'copula'
    
     The following object is masked from 'package:simcausal':
    
     A
    
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     [1] "current list of user-defined vectorized functions: qbinom"
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x26ba408>
     <environment: 0x1ed5f188>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.417 0.091 1.952
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.NSEbug ... [1] "s"
     [1] 1
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     existing node L1_0 was modified
     [1] "s"
     [1] 3
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     existing node L1_0 was modified
     [1] "s"
     [1] 1
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     existing node L1_2 was modified
     [1] "s"
     [1] 2
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     done successfully.
    
     ------------------- UNIT TEST SUMMARY ---------------------
    
     RUNIT TEST PROTOCOL -- Wed Feb 19 03:03:05 2020
     ***********************************************
     Number of test functions: 28
     Number of errors: 9
     Number of failures: 0
    
    
     1 Test Suite :
     simcausal unit testing - 28 test functions, 9 errors, 0 failures
     ERROR in test.bugfixes: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.condrcat.factor: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.latent: Error in set.DAG(D, latent.v = c("I", "U.Y")) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.longparse: Error in set.DAG(D2) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.noexistdistr: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.substitute: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.networkgen1: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.networkgen2: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.MV: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error:
    
     unit testing failed (#test failures: 0, #R errors: 9)
    
     Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 0.5.5
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building 'simcausal_vignette.Rnw' using knitr
    ...automatically assigning order attribute to some nodes...
    node race, order:1
    node W1, order:2
    node W2, order:3
    node W3, order:4
    node Anode, order:5
    node Y, order:6
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    simcausal
     --- call from context ---
    standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
    if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
    } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
    } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
    } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
    }
     --- R stacktrace ---
    where 1: standardize_param(newNodeParams$dist_params[[idx]])
    where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
    where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
    where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
    where 10: set.DAG(D)
    where 11: eval(expr, envir, enclos)
    where 12: eval(expr, envir, enclos)
    where 13: withVisible(eval(expr, envir, enclos))
    where 14: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 15: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 16: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 17: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 18: evaluate::evaluate(...)
    where 19: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 20: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 21: block_exec(params)
    where 22: call_block(x)
    where 23: process_group.block(group)
    where 24: process_group(group)
    where 25: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 26: process_file(text, output)
    where 27: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$",
     file)) knit2pandoc else knit)(file, encoding = encoding,
     quiet = quiet, envir = globalenv(), ...)
    where 28: engine$weave(file, quiet = quiet, encoding = enc)
    where 29: doTryCatch(return(expr), name, parentenv, handler)
    where 30: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 31: tryCatchList(expr, classes, parentenv, handlers)
    where 32: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 33: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/simcausal.Rcheck/vign_test/simcausal",
     ser_elibs = "/tmp/RtmpbRZhPi/file67e361be3c56.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (distparam)
    {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
    }
    <bytecode: 0x14be208>
    <environment: 0x273a690>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Quitting from lines 912-935 (simcausal_vignette.Rnw)
    Error: processing vignette 'simcausal_vignette.Rnw' failed with diagnostics:
    
    ...attempt to simulate data from DAG failed...
    --- failed re-building 'simcausal_vignette.Rnw'
    
    SUMMARY: processing the following file failed:
     'simcausal_vignette.Rnw'
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 0.5.5
Check: examples
Result: ERROR
    Running examples in ‘simcausal-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: network
    > ### Title: Define a Network Generator
    > ### Aliases: network
    >
    > ### ** Examples
    >
    > #--------------------------------------------------------------------------------------------------
    > # EXAMPLE 1. USING igraph R PACKAGE TO SIMULATE NETWORKS
    > #--------------------------------------------------------------------------------------------------
    >
    > #--------------------------------------------------------------------------------------------------
    > # Example of a network sampler, will be provided as "netfun" argument to network(, netfun=);
    > # Generates a random graph according to the G(n,m) Erdos-Renyi model using the igraph package;
    > # Returns (n,Kmax) matrix of net IDs (friends) by row;
    > # Row i contains the IDs (row numbers) of i's friends;
    > # i's friends are assumed connected to i and can influence i in equations defined by node())
    > # When i has less than Kmax friends, the remaining i row entries are filled with NAs;
    > # Argument m_pn: > 0
    > # a total number of edges in the network as a fraction (or multiplier) of n (sample size)
    > #--------------------------------------------------------------------------------------------------
    > gen.ER <- function(n, m_pn, ...) {
    + m <- as.integer(m_pn*n)
    + if (n<=10) m <- 20
    + igraph.ER <- igraph::sample_gnm(n = n, m = m, directed = TRUE)
    + sparse_AdjMat <- igraph.to.sparseAdjMat(igraph.ER)
    + NetInd_out <- sparseAdjMat.to.NetInd(sparse_AdjMat)
    + return(NetInd_out$NetInd_k)
    + }
    >
    > D <- DAG.empty()
    > # Sample ER model network using igraph::sample_gnm with m_pn argument:
    > D <- D + network("ER.net", netfun = "gen.ER", m_pn = 50)
    > # W1 - categorical (6 categories, 1-6):
    > D <- D +
    + node("W1", distr = "rcat.b1",
    + probs = c(0.0494, 0.1823, 0.2806, 0.2680, 0.1651, 0.0546)) +
    + # W2 - binary infection status, positively correlated with W1:
    + node("W2", distr = "rbern", prob = plogis(-0.2 + W1/3)) +
    + # W3 - binary confounder:
    + node("W3", distr = "rbern", prob = 0.6)
    > # A[i] is a function W1[i] and the total of i's friends values W1, W2 and W3:
    > D <- D + node("A", distr = "rbern",
    + prob = plogis(2 + -0.5 * W1 +
    + -0.1 * sum(W1[[1:Kmax]]) +
    + -0.4 * sum(W2[[1:Kmax]]) +
    + -0.7 * sum(W3[[1:Kmax]])),
    + replaceNAw0 = TRUE)
    > # Y[i] is a function of netW3 (friends of i W3 values) and the total N of i's friends
    > # who are infected AND untreated:
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 2 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    > # Can add N untreated friends to the above outcome Y equation: sum(1 - A[[1:Kmax]]):
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 1.5 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]]) +
    + 0.25 * sum(1 - A[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    existing node Y was modified
    > # Can add N infected friends at baseline to the above outcome Y equation: sum(W2[[1:Kmax]]):
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 1 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]]) +
    + 0.25 * sum(1 - A[[1:Kmax]]) +
    + 0.25 * sum(W2[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    existing node Y was modified
    > Dset <- set.DAG(D, n.test = 100)
    ...automatically assigning order attribute to some nodes...
    node ER.net, order:1
    node W1, order:2
    node W2, order:3
    node W3, order:4
    node A, order:5
    node Y, order:6
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    simcausal
     --- call from context ---
    standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
    if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
    } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
    } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
    } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
    }
     --- R stacktrace ---
    where 1: standardize_param(newNodeParams$dist_params[[idx]])
    where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
    where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
    where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
    where 10: set.DAG(D, n.test = 100)
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (distparam)
    {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
    }
    <bytecode: 0x5560f3044808>
    <environment: 0x5560fc686600>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
    Error in set.DAG(D, n.test = 100) :
    ...attempt to simulate data from DAG failed...
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 0.5.5
Check: tests
Result: ERROR
     Running ‘test-all.R’ [105s/151s]
    Running the tests in ‘tests/test-all.R’ failed.
    Complete output:
     > ## unit tests will not be done if RUnit is not available
     > # setwd("..")
     > # getwd()
     > # library(RUnit)
     > if(require("RUnit", quietly=TRUE)) {
     + ## --- Setup ---
     +
     + pkg <- "simcausal" # <-- Tested 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(), "..", "inst", "unitTests")
     + } else {
     + ## Path to unit tests for R CMD check
     + ## PKG.Rcheck/tests/../PKG/unitTests
     + # path <- system.file(package=pkg, "RUnit")
     +
     + # REPLACED WITH:
     + path <- file.path(getwd(), "RUnit")
     + }
     +
     + 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
     + test.suite <- defineTestSuite(name=paste(pkg, "unit testing"),
     + # dirs="./RUnit",
     + dirs=path,
     + testFileRegexp = "^RUnit_tests_+",
     + testFuncRegexp = "^test.+",
     + rngKind = "Marsaglia-Multicarry",
     + rngNormalKind = "Kinderman-Ramage")
     + ## Run
     + tests <- runTestSuite(test.suite)
     +
     + ## Default report name
     + pathReport <- file.path(path, "report")
     +
     + ## Report to stdout and text files
     + cat("------------------- UNIT TEST SUMMARY ---------------------\n\n")
     + printTextProtocol(tests, showDetails=FALSE)
     + printTextProtocol(tests, showDetails=FALSE,
     + fileName=paste0(pathReport, "Summary.txt"))
     + printTextProtocol(tests, showDetails=TRUE,
     + fileName=paste0(pathReport, ".txt"))
     + ## Report to HTML file
     + printHTMLProtocol(tests, fileName=paste0(pathReport, ".html"))
     +
     + ## 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] "simcausal"
    
     $getwd
     [1] "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/simcausal.Rcheck/tests"
    
     $pathToUnitTests
     [1] "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/simcausal.Rcheck/tests/RUnit"
    
    
    
     Executing test function test.EFUeval ... ...automatically assigning order attribute to some nodes...
     node C.time_0, order:1
     node Y_0, order:2
     node D_0, order:3
     node C.time_1, order:4
     node Y_1, order:5
     node D_1, order:6
     node C.time_2, order:7
     node Y_2, order:8
     node D_2, order:9
     node C.time_3, order:10
     node Y_3, order:11
     node D_3, order:12
     node C.time_4, order:13
     node Y_4, order:14
     node D_4, order:15
     node C.time_5, order:16
     node Y_5, order:17
     node D_5, order:18
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node C.time_0, order:1
     node Y_0, order:2
     node D_0, order:3
     node C.time_1, order:4
     node Y_1, order:5
     node D_1, order:6
     node C.time_2, order:7
     node Y_2, order:8
     node D_2, order:9
     node C.time_3, order:10
     node Y_3, order:11
     node D_3, order:12
     node C.time_4, order:13
     node Y_4, order:14
     node D_4, order:15
     node C.time_5, order:16
     node Y_5, order:17
     node D_5, order:18
     using the following vertex attributes:
     NAdarkbluenone70.50
     using the following edge attributes:
     black0.210.30.2
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.Nsamp.n.test ... ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     done successfully.
    
    
    
     Executing test function test.bugfixes ... ...automatically assigning order attribute to some nodes...
     node const, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     node Y, order:6
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node L2_1, order:5
     node L2_2, order:6
     node L2_3, order:7
     node L2_4, order:8
     node L2_5, order:9
     node L2_6, order:10
     node L2_7, order:11
     node L2_8, order:12
     node L2_9, order:13
     node L2_10, order:14
     node L2_11, order:15
     node L2_12, order:16
     node L2_13, order:17
     node L2_14, order:18
     node L2_15, order:19
     node L2_16, order:20
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node L2_1, order:3
     node L1_1, order:4
     node L2_2, order:5
     node L1_2, order:6
     node L2_3, order:7
     node L1_3, order:8
     node L2_4, order:9
     node L1_4, order:10
     node L2_5, order:11
     node L1_5, order:12
     node L2_6, order:13
     node L1_6, order:14
     node L2_7, order:15
     node L1_7, order:16
     node L2_8, order:17
     node L1_8, order:18
     node L2_9, order:19
     node L1_9, order:20
     node L2_10, order:21
     node L1_10, order:22
     node L2_11, order:23
     node L1_11, order:24
     node L2_12, order:25
     node L1_12, order:26
     node L2_13, order:27
     node L1_13, order:28
     node L2_14, order:29
     node L1_14, order:30
     node L2_15, order:31
     node L1_15, order:32
     node L2_16, order:33
     node L1_16, order:34
     Error in add.nodes(DAG = obj1, nodes = obj2) :
     DAG object is locked: nodes in this DAG cannot be modified or added after set.DAG()
     In addition: Warning messages:
     1: In add.nodes(DAG = obj1, nodes = obj2) :
     existing non-time-varying node L2 was overwritten with a time-varying node
     2: In add.nodes(DAG = obj1, nodes = obj2) :
     existing non-time-varying node L2 was overwritten with a time-varying node
     3: In set.DAG(D) :
     trying to lock an empty DAG, add nodes before calling set.DAG()
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2bdbce690>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.109 0.089 2.044
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.condrcat.factor ... ...automatically assigning order attribute to some nodes...
     node W, order:1
     node Cat3, order:2
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2c7630060>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.218 0 0.273
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.distr ... All custom distributions defined in SimCausal:
    
     [1] "rbern" "rcat.b0" "rcat.b1" "rcat.factor"
     [5] "rcategor" "rcategor.int" "rconst" "rdistr.template"
     Error in rdistr.template(n = 100, arg1 = rep(0.5, 100), arg2 = rep(0.3, :
     inputs arguments should all have the same length
     done successfully.
    
    
    
     Executing test function test.experimental_parsingMSMs ... Error in simcausal:::parse.MSMform(msm.form = msm.form_3_error, t_vec = t_vec, :
     unable to map some of S() expressions in MSM formula, check that all of the summary measure expressions have been previously defined
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     for df_full in long format new summary measures cannot be calculated, using whatever summary measures already exist in df_full
     for df_full in long format outcome is pooled over the same t vector as defined in the first MSM that generated the long format data, changing pooling t requires re-generating the full data
     assuming the data is based on the following map of MSM terms to variable names
     S_exprs_vec XMSMterms
     1 A1[max(0, t - 2)] XMSMterm.4
     MSM: fitting glm to full data
     for df_full in long format new summary measures cannot be calculated, using whatever summary measures already exist in df_full
     for df_full in long format outcome is pooled over the same t vector as defined in the first MSM that generated the long format data, changing pooling t requires re-generating the full data
     assuming the data is based on the following map of MSM terms to variable names
     S_exprs_vec XMSMterms
     1 A1[max(0, t - 2)] XMSMterm.4
     2 A1[max(0, t - 1)] XMSMterm.1
     MSM: fitting glm to full data
     Error in parse.MSMform(msm.form = form, t_vec = t_vec, old.DAG = DAG, :
     unable to map some of S() expressions in MSM formula, check that all of the summary measure expressions have been previously defined
     done successfully.
    
    
    
     Executing test function test.faster_tolongdata ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.latent ... ...automatically assigning order attribute to some nodes...
     node I, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     node U.Y, order:6
     node Y, order:7
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D, latent.v = c("I", "U.Y"))
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2c3c5f038>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.023 0 0.023
     Error in set.DAG(D, latent.v = c("I", "U.Y")) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.longparse ... ...automatically assigning order attribute to some nodes...
     node group, order:1
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D2)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2c2f385b0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.017 0 0.017
     Error in set.DAG(D2) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.node ... ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     node L2, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     existing node W1 was modified
     existing node W2 was modified
     existing node W3 was modified
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L1_0, order:1
     node L2_0, order:2
     Error in add.nodes(DAG = obj1, nodes = obj2) :
     cannot define nodes with missing t after nodes with t non-missing were already defined
     In addition: Warning messages:
     1: In rcat.b1(n = n, probs = probs) :
     some categorical probabilities add up to more than 1, normalizing to add to 1
     2: In rcat.b1(n = n, probs = probs) :
     some categorical probabilities add up to more than 1, normalizing to add to 1
     existing node L1_3 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     ...automatically assigning order attribute to some nodes...
     node L1_0, order:1
     node L2_0, order:2
     node L1_1, order:3
     node L2_1, order:4
     node L1_2, order:5
     node L2_2, order:6
     node L1_3, order:7
     node L2_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L1_5, order:11
     node L2_5, order:12
     simulating observed dataset from the DAG object
     existing node L1_2 was modified
     existing node L1_3 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     ...automatically assigning order attribute to some nodes...
     node L3_0, order:1
     node L3_1, order:2
     node L1_2, order:3
     node L2_2, order:4
     node L3_2, order:5
     node L1_3, order:6
     node L2_3, order:7
     node L3_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L3_4, order:11
     node L1_5, order:12
     node L2_5, order:13
     node L3_5, order:14
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L3_0, order:1
     node L3_1, order:2
     node L1_2, order:3
     node L2_2, order:4
     node L3_2, order:5
     node L1_3, order:6
     node L2_3, order:7
     node L3_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L3_4, order:11
     node L1_5, order:12
     node L2_5, order:13
     node L3_5, order:14
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node A2_0, order:4
     node Y_0, order:5
     node L2_1, order:6
     node A1_1, order:7
     node A2_1, order:8
     node Y_1, order:9
     node L2_2, order:10
     node A1_2, order:11
     node A2_2, order:12
     node Y_2, order:13
     node L2_3, order:14
     node A1_3, order:15
     node A2_3, order:16
     node Y_3, order:17
     node L2_4, order:18
     node A1_4, order:19
     node A2_4, order:20
     node Y_4, order:21
     node L2_5, order:22
     node A1_5, order:23
     node A2_5, order:24
     node Y_5, order:25
     node L2_6, order:26
     node A1_6, order:27
     node A2_6, order:28
     node Y_6, order:29
     node L2_7, order:30
     node A1_7, order:31
     node A2_7, order:32
     node Y_7, order:33
     node L2_8, order:34
     node A1_8, order:35
     node A2_8, order:36
     node Y_8, order:37
     node L2_9, order:38
     node A1_9, order:39
     node A2_9, order:40
     node Y_9, order:41
     node L2_10, order:42
     node A1_10, order:43
     node A2_10, order:44
     node Y_10, order:45
     node L2_11, order:46
     node A1_11, order:47
     node A2_11, order:48
     node Y_11, order:49
     node L2_12, order:50
     node A1_12, order:51
     node A2_12, order:52
     node Y_12, order:53
     node L2_13, order:54
     node A1_13, order:55
     node A2_13, order:56
     node Y_13, order:57
     node L2_14, order:58
     node A1_14, order:59
     node A2_14, order:60
     node Y_14, order:61
     node L2_15, order:62
     node A1_15, order:63
     node A2_15, order:64
     node Y_15, order:65
     node L2_16, order:66
     node A1_16, order:67
     node A2_16, order:68
     node Y_16, order:69
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.noexistdistr ... ...automatically assigning order attribute to some nodes...
     node W1, order:1
     rbinom2: note this distribution could not be located in package namespace, simulating from user-defined distribution found under the same name
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2cb9af6e0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.016 0.004 0.019
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.plotting ... ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node A2_0, order:4
     node Y_0, order:5
     node L2_1, order:6
     node A1_1, order:7
     node A2_1, order:8
     node Y_1, order:9
     node L2_2, order:10
     node A1_2, order:11
     node A2_2, order:12
     node Y_2, order:13
     node L2_3, order:14
     node A1_3, order:15
     node A2_3, order:16
     node Y_3, order:17
     node L2_4, order:18
     node A1_4, order:19
     node A2_4, order:20
     node Y_4, order:21
     node L2_5, order:22
     node A1_5, order:23
     node A2_5, order:24
     node Y_5, order:25
     node L2_6, order:26
     node A1_6, order:27
     node A2_6, order:28
     node Y_6, order:29
     node L2_7, order:30
     node A1_7, order:31
     node A2_7, order:32
     node Y_7, order:33
     node L2_8, order:34
     node A1_8, order:35
     node A2_8, order:36
     node Y_8, order:37
     node L2_9, order:38
     node A1_9, order:39
     node A2_9, order:40
     node Y_9, order:41
     node L2_10, order:42
     node A1_10, order:43
     node A2_10, order:44
     node Y_10, order:45
     node L2_11, order:46
     node A1_11, order:47
     node A2_11, order:48
     node Y_11, order:49
     node L2_12, order:50
     node A1_12, order:51
     node A2_12, order:52
     node Y_12, order:53
     node L2_13, order:54
     node A1_13, order:55
     node A2_13, order:56
     node Y_13, order:57
     node L2_14, order:58
     node A1_14, order:59
     node A2_14, order:60
     node Y_14, order:61
     node L2_15, order:62
     node A1_15, order:63
     node A2_15, order:64
     node Y_15, order:65
     node L2_16, order:66
     node A1_16, order:67
     node A2_16, order:68
     node Y_16, order:69
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG1 ... simulating observed dataset from the DAG object
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG2_errors ... Error in node("A_2", distr = "rbern", prob = 0.5, order = 1) :
     node names with underscore character '_' are not allowed
     Error in L2[0] : undefined time-dependent variable(s): L2_0
     Error : error while evaluating node L2_0 formula:
     ifelse(L2[0] == 1, 0.5, 0.1).
     Check syntax specification.
     Error in set.DAG(c(L2_0, L1_0)) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node , order:1
     node , order:2
     node , order:3
     node , order:4
     Error in strsplit(cur.node$name, "_") : non-character argument
     Error in set.DAG(testDAG_2_err1a) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node , order:1
     node , order:2
     node , order:3
     node , order:4
     node , order:5
     Error in set.DAG(testDAG_2_err1b) :
     All DAG nodes must have unique name attributes
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG2b_newactions ... ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     node A, order:4
     node Y, order:5
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     node A, order:4
     node Y, order:5
     ...automatically assigning order attribute to some nodes...
     node W1_0, order:1
     node W2_0, order:2
     node W3_0, order:3
     node A_0, order:4
     node Y_0, order:5
     node W1_1, order:6
     node W2_1, order:7
     node W3_1, order:8
     node A_1, order:9
     node Y_1, order:10
     ...automatically assigning order attribute to some nodes...
     node W1_0, order:1
     node W2_0, order:2
     node W3_0, order:3
     node A_0, order:4
     node Y_0, order:5
     node W1_1, order:6
     node W2_1, order:7
     node W3_1, order:8
     node A_1, order:9
     node Y_1, order:10
     simulating observed dataset from the DAG object
     using the following vertex attributes:
     NAdarkbluenone100.50
     using the following edge attributes:
     black0.210.60.5
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     Error : n is not a count (a single positive integer)
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     Error in getactions(DAG, actions) :
     Couldn't locate action: A4 , first define action by adding it to the DAG object with DAG+action
     In addition: There were 13 warnings (use warnings() to see them)
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     user system elapsed
     0.384 0.004 0.784
     simulating observed dataset from the DAG object
     user system elapsed
     0.395 0.004 0.423
     simulating observed dataset from the DAG object
     user system elapsed
     0.424 0.000 0.732
     Error in X_dat_th0[[2]] : subscript out of bounds
     In addition: There were 11 warnings (use warnings() to see them)
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     Error in eval.target(D, n = 500, actions = "A1_th1", rndseed = 123) :
     some of the actions in param argument could not be found in the simulated full data
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG3_wlong ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG_informcens ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_general ... Error in set.DAG(testDAG_listobj1) : DAG must be a list
     In addition: Warning messages:
     1: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type == :
     prediction from a rank-deficient fit may be misleading
     2: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type == :
     prediction from a rank-deficient fit may be misleading
     Error in set.DAG(testDAG_listobj2) :
     each of DAG items must be a list specifying DAG node(s)
     ...automatically assigning order attribute to some nodes...
     node nm, order:1
     node nm, order:2
     node nm, order:3
     Error : !is.null(user.env) is not TRUE
     Error in set.DAG(testDAG_names1) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node nm, order:2
     node nm, order:3
     Error : !is.null(user.env) is not TRUE
     Error in set.DAG(testDAG_names2) :
     ...attempt to simulate data from DAG failed...
     Error in set.DAG(testDAG_dist) :
     All DAG nodes must have unique name attributes
     done successfully.
    
    
    
     Executing test function test.substitute ... ...automatically assigning order attribute to some nodes...
     node I, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2cbb35ab0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.023 0 0.023
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.t.error ... Error in add.nodes(DAG = obj1, nodes = obj2) :
     cannot define nodes with missing t after nodes with t non-missing were already defined
     done successfully.
    
    
    
     Executing test function test.tswitch_2MSMs ... [1] 0
     [1] "abar"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 3
     [1] "abar"
     [1] 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 6
     [1] "abar"
     [1] 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1
     [1] 10
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
     [1] 13
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
     [1] 17
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "tswitch_i"
     [1] 0
     [1] "meanExposureVec"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "tswitch_i"
     [1] 3
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.250 0.400 0.500 0.571 0.625 0.667 0.700 0.727 0.750
     [13] 0.769 0.786 0.800 0.812 0.824
     [1] "tswitch_i"
     [1] 6
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.143 0.250 0.333 0.400 0.455 0.500
     [13] 0.538 0.571 0.600 0.625 0.647
     [1] "tswitch_i"
     [1] 10
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.091 0.167
     [13] 0.231 0.286 0.333 0.375 0.412
     [1] "tswitch_i"
     [1] 13
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
     [13] 0.000 0.071 0.133 0.188 0.235
     [1] "tswitch_i"
     [1] 17
     [1] "meanExposureVec"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] 0
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 5
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.2857143
     [8] 0.3750000 0.4444444 0.5000000 0.5454545 0.5833333 0.6153846 0.6428571
     [15] 0.6666667 0.6875000 0.7058824
     [1] 10
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] 17
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 200 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.2857143
     [8] 0.3750000 0.4444444 0.5000000 0.5454545 0.5833333 0.6153846 0.6428571
     [15] 0.6666667 0.6875000 0.7058824
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     done successfully.
    
    
    
     Executing test function test.long.wide.simobs ... done successfully.
    
    
    
     Executing test function test.networkgen1 ... [1] "automatic Kmax: "
     [1] 1
     [1] "NetInd_k"
     [,1]
     [1,] NA
     [2,] 1
     [3,] NA
     [4,] 2
     [5,] NA
     [6,] NA
     existing node Net.sample was modified
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 3
     [1] "NetInd_k"
     [,1] [,2] [,3]
     [1,] 5 7 NA
     [2,] NA NA NA
     [3,] 9 NA NA
     [4,] 5 NA NA
     [5,] 2 NA NA
     [6,] 2 NA NA
     existing node Net.sample was modified
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 3
     [1] "NetInd_k"
     [,1] [,2] [,3]
     [1,] 6 8 9
     [2,] 6 NA NA
     [3,] 4 NA NA
     [4,] 8 NA NA
     [5,] NA NA NA
     [6,] 7 NA NA
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 3
     [1] "NetInd_k"
     [,1] [,2] [,3]
     [1,] NA NA NA
     [2,] 10 NA NA
     [3,] 1 4 6
     [4,] 5 NA NA
     [5,] 7 NA NA
     [6,] NA NA NA
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2d0e955e0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.769 0.02 3.177
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.networkgen2 ... ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2d3ec5e90>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.026 0 0.042
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.networkgen_time ... Error in W2[[0]] : variable W2 doesn't exist
     Error : error while evaluating node F.W2_0 formula:
     W2[[0]].
     Check syntax specification.
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error in F.W1[0:1][[0]] :
     ...network indexing variable evaluated to more than one column ...
     Error : error while evaluating node F.W1_2 formula:
     F.W1[0:1][[0]].
     Check syntax specification.
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error : Undefined variable: F.A
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.tKmaxnet ... Error in eval.nodeform.full(expr_call = expr_call, expr_str = expr_str, :
     reference A[...] at node B is not allowed; node A was defined as time-invariant
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     Error : Undefined variable: xyz
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     Error in eval.nodeform.full(expr_call = expr_call, expr_str = expr_str, :
     reference A[...] at node B is not allowed; node A was defined as time-invariant
     In addition: Warning message:
     In FUN(X[[i]], ...) : the argument inside [...] cannot be parsed: A[rnorm]
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.MV ... Loading required package: mvtnorm
     ...automatically assigning order attribute to some nodes...
     node X1.X2.X3, order:1
     node Y1.Y2, order:2
     node A, order:3
     Loading required package: copula
    
     Attaching package: 'copula'
    
     The following object is masked from 'package:simcausal':
    
     A
    
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     [1] "current list of user-defined vectorized functions: qbinom"
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x55c2bdc46e80>
     <environment: 0x55c2d9c2d970>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.826 0.043 1.68
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.NSEbug ... [1] "s"
     [1] 1
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     existing node L1_0 was modified
     [1] "s"
     [1] 3
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     existing node L1_0 was modified
     [1] "s"
     [1] 1
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     existing node L1_2 was modified
     [1] "s"
     [1] 2
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     done successfully.
    
     ------------------- UNIT TEST SUMMARY ---------------------
    
     RUNIT TEST PROTOCOL -- Tue Feb 18 23:46:41 2020
     ***********************************************
     Number of test functions: 28
     Number of errors: 9
     Number of failures: 0
    
    
     1 Test Suite :
     simcausal unit testing - 28 test functions, 9 errors, 0 failures
     ERROR in test.bugfixes: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.condrcat.factor: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.latent: Error in set.DAG(D, latent.v = c("I", "U.Y")) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.longparse: Error in set.DAG(D2) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.noexistdistr: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.substitute: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.networkgen1: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.networkgen2: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.MV: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error:
    
     unit testing failed (#test failures: 0, #R errors: 9)
    
     Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 0.5.5
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building ‘simcausal_vignette.Rnw’ using knitr
    ...automatically assigning order attribute to some nodes...
    node race, order:1
    node W1, order:2
    node W2, order:3
    node W3, order:4
    node Anode, order:5
    node Y, order:6
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    simcausal
     --- call from context ---
    standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
    if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
    } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
    } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
    } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
    }
     --- R stacktrace ---
    where 1: standardize_param(newNodeParams$dist_params[[idx]])
    where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
    where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
    where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
    where 10: set.DAG(D)
    where 11: eval(expr, envir, enclos)
    where 12: eval(expr, envir, enclos)
    where 13: withVisible(eval(expr, envir, enclos))
    where 14: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 15: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 16: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 17: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 18: evaluate::evaluate(...)
    where 19: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 20: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 21: block_exec(params)
    where 22: call_block(x)
    where 23: process_group.block(group)
    where 24: process_group(group)
    where 25: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 26: process_file(text, output)
    where 27: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$",
     file)) knit2pandoc else knit)(file, encoding = encoding,
     quiet = quiet, envir = globalenv(), ...)
    where 28: engine$weave(file, quiet = quiet, encoding = enc)
    where 29: doTryCatch(return(expr), name, parentenv, handler)
    where 30: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 31: tryCatchList(expr, classes, parentenv, handlers)
    where 32: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 33: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/simcausal.Rcheck/vign_test/simcausal",
     ser_elibs = "/home/hornik/tmp/scratch/RtmpHcu1EK/file4c59652f9240.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (distparam)
    {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
    }
    <bytecode: 0x55fb1f42f1c8>
    <environment: 0x55fb2030ae98>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Quitting from lines 912-935 (simcausal_vignette.Rnw)
    Error: processing vignette 'simcausal_vignette.Rnw' failed with diagnostics:
    
    ...attempt to simulate data from DAG failed...
    --- failed re-building ‘simcausal_vignette.Rnw’
    
    SUMMARY: processing the following file failed:
     ‘simcausal_vignette.Rnw’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 0.5.5
Check: examples
Result: ERROR
    Running examples in ‘simcausal-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: network
    > ### Title: Define a Network Generator
    > ### Aliases: network
    >
    > ### ** Examples
    >
    > #--------------------------------------------------------------------------------------------------
    > # EXAMPLE 1. USING igraph R PACKAGE TO SIMULATE NETWORKS
    > #--------------------------------------------------------------------------------------------------
    >
    > #--------------------------------------------------------------------------------------------------
    > # Example of a network sampler, will be provided as "netfun" argument to network(, netfun=);
    > # Generates a random graph according to the G(n,m) Erdos-Renyi model using the igraph package;
    > # Returns (n,Kmax) matrix of net IDs (friends) by row;
    > # Row i contains the IDs (row numbers) of i's friends;
    > # i's friends are assumed connected to i and can influence i in equations defined by node())
    > # When i has less than Kmax friends, the remaining i row entries are filled with NAs;
    > # Argument m_pn: > 0
    > # a total number of edges in the network as a fraction (or multiplier) of n (sample size)
    > #--------------------------------------------------------------------------------------------------
    > gen.ER <- function(n, m_pn, ...) {
    + m <- as.integer(m_pn*n)
    + if (n<=10) m <- 20
    + igraph.ER <- igraph::sample_gnm(n = n, m = m, directed = TRUE)
    + sparse_AdjMat <- igraph.to.sparseAdjMat(igraph.ER)
    + NetInd_out <- sparseAdjMat.to.NetInd(sparse_AdjMat)
    + return(NetInd_out$NetInd_k)
    + }
    >
    > D <- DAG.empty()
    > # Sample ER model network using igraph::sample_gnm with m_pn argument:
    > D <- D + network("ER.net", netfun = "gen.ER", m_pn = 50)
    > # W1 - categorical (6 categories, 1-6):
    > D <- D +
    + node("W1", distr = "rcat.b1",
    + probs = c(0.0494, 0.1823, 0.2806, 0.2680, 0.1651, 0.0546)) +
    + # W2 - binary infection status, positively correlated with W1:
    + node("W2", distr = "rbern", prob = plogis(-0.2 + W1/3)) +
    + # W3 - binary confounder:
    + node("W3", distr = "rbern", prob = 0.6)
    > # A[i] is a function W1[i] and the total of i's friends values W1, W2 and W3:
    > D <- D + node("A", distr = "rbern",
    + prob = plogis(2 + -0.5 * W1 +
    + -0.1 * sum(W1[[1:Kmax]]) +
    + -0.4 * sum(W2[[1:Kmax]]) +
    + -0.7 * sum(W3[[1:Kmax]])),
    + replaceNAw0 = TRUE)
    > # Y[i] is a function of netW3 (friends of i W3 values) and the total N of i's friends
    > # who are infected AND untreated:
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 2 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    > # Can add N untreated friends to the above outcome Y equation: sum(1 - A[[1:Kmax]]):
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 1.5 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]]) +
    + 0.25 * sum(1 - A[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    existing node Y was modified
    > # Can add N infected friends at baseline to the above outcome Y equation: sum(W2[[1:Kmax]]):
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 1 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]]) +
    + 0.25 * sum(1 - A[[1:Kmax]]) +
    + 0.25 * sum(W2[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    existing node Y was modified
    > Dset <- set.DAG(D, n.test = 100)
    ...automatically assigning order attribute to some nodes...
    node ER.net, order:1
    node W1, order:2
    node W2, order:3
    node W3, order:4
    node A, order:5
    node Y, order:6
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    simcausal
     --- call from context ---
    standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
    if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
    } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
    } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
    } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
    }
     --- R stacktrace ---
    where 1: standardize_param(newNodeParams$dist_params[[idx]])
    where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
    where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
    where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
    where 10: set.DAG(D, n.test = 100)
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (distparam)
    {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
    }
    <bytecode: 0x1d61430>
    <environment: 0xa04f080>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
    Error in set.DAG(D, n.test = 100) :
    ...attempt to simulate data from DAG failed...
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 0.5.5
Check: tests
Result: ERROR
     Running ‘test-all.R’ [143s/166s]
    Running the tests in ‘tests/test-all.R’ failed.
    Complete output:
     > ## unit tests will not be done if RUnit is not available
     > # setwd("..")
     > # getwd()
     > # library(RUnit)
     > if(require("RUnit", quietly=TRUE)) {
     + ## --- Setup ---
     +
     + pkg <- "simcausal" # <-- Tested 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(), "..", "inst", "unitTests")
     + } else {
     + ## Path to unit tests for R CMD check
     + ## PKG.Rcheck/tests/../PKG/unitTests
     + # path <- system.file(package=pkg, "RUnit")
     +
     + # REPLACED WITH:
     + path <- file.path(getwd(), "RUnit")
     + }
     +
     + 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
     + test.suite <- defineTestSuite(name=paste(pkg, "unit testing"),
     + # dirs="./RUnit",
     + dirs=path,
     + testFileRegexp = "^RUnit_tests_+",
     + testFuncRegexp = "^test.+",
     + rngKind = "Marsaglia-Multicarry",
     + rngNormalKind = "Kinderman-Ramage")
     + ## Run
     + tests <- runTestSuite(test.suite)
     +
     + ## Default report name
     + pathReport <- file.path(path, "report")
     +
     + ## Report to stdout and text files
     + cat("------------------- UNIT TEST SUMMARY ---------------------\n\n")
     + printTextProtocol(tests, showDetails=FALSE)
     + printTextProtocol(tests, showDetails=FALSE,
     + fileName=paste0(pathReport, "Summary.txt"))
     + printTextProtocol(tests, showDetails=TRUE,
     + fileName=paste0(pathReport, ".txt"))
     + ## Report to HTML file
     + printHTMLProtocol(tests, fileName=paste0(pathReport, ".html"))
     +
     + ## 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] "simcausal"
    
     $getwd
     [1] "/data/gannet/ripley/R/packages/tests-clang/simcausal.Rcheck/tests"
    
     $pathToUnitTests
     [1] "/data/gannet/ripley/R/packages/tests-clang/simcausal.Rcheck/tests/RUnit"
    
    
    
     Executing test function test.EFUeval ... ...automatically assigning order attribute to some nodes...
     node C.time_0, order:1
     node Y_0, order:2
     node D_0, order:3
     node C.time_1, order:4
     node Y_1, order:5
     node D_1, order:6
     node C.time_2, order:7
     node Y_2, order:8
     node D_2, order:9
     node C.time_3, order:10
     node Y_3, order:11
     node D_3, order:12
     node C.time_4, order:13
     node Y_4, order:14
     node D_4, order:15
     node C.time_5, order:16
     node Y_5, order:17
     node D_5, order:18
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node C.time_0, order:1
     node Y_0, order:2
     node D_0, order:3
     node C.time_1, order:4
     node Y_1, order:5
     node D_1, order:6
     node C.time_2, order:7
     node Y_2, order:8
     node D_2, order:9
     node C.time_3, order:10
     node Y_3, order:11
     node D_3, order:12
     node C.time_4, order:13
     node Y_4, order:14
     node D_4, order:15
     node C.time_5, order:16
     node Y_5, order:17
     node D_5, order:18
     using the following vertex attributes:
     NAdarkbluenone70.50
     using the following edge attributes:
     black0.210.30.2
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.Nsamp.n.test ... ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     done successfully.
    
    
    
     Executing test function test.bugfixes ... ...automatically assigning order attribute to some nodes...
     node const, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     node Y, order:6
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node L2_1, order:5
     node L2_2, order:6
     node L2_3, order:7
     node L2_4, order:8
     node L2_5, order:9
     node L2_6, order:10
     node L2_7, order:11
     node L2_8, order:12
     node L2_9, order:13
     node L2_10, order:14
     node L2_11, order:15
     node L2_12, order:16
     node L2_13, order:17
     node L2_14, order:18
     node L2_15, order:19
     node L2_16, order:20
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node L2_1, order:3
     node L1_1, order:4
     node L2_2, order:5
     node L1_2, order:6
     node L2_3, order:7
     node L1_3, order:8
     node L2_4, order:9
     node L1_4, order:10
     node L2_5, order:11
     node L1_5, order:12
     node L2_6, order:13
     node L1_6, order:14
     node L2_7, order:15
     node L1_7, order:16
     node L2_8, order:17
     node L1_8, order:18
     node L2_9, order:19
     node L1_9, order:20
     node L2_10, order:21
     node L1_10, order:22
     node L2_11, order:23
     node L1_11, order:24
     node L2_12, order:25
     node L1_12, order:26
     node L2_13, order:27
     node L1_13, order:28
     node L2_14, order:29
     node L1_14, order:30
     node L2_15, order:31
     node L1_15, order:32
     node L2_16, order:33
     node L1_16, order:34
     Error in add.nodes(DAG = obj1, nodes = obj2) :
     DAG object is locked: nodes in this DAG cannot be modified or added after set.DAG()
     In addition: Warning messages:
     1: In add.nodes(DAG = obj1, nodes = obj2) :
     existing non-time-varying node L2 was overwritten with a time-varying node
     2: In add.nodes(DAG = obj1, nodes = obj2) :
     existing non-time-varying node L2 was overwritten with a time-varying node
     3: In set.DAG(D) :
     trying to lock an empty DAG, add nodes before calling set.DAG()
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0x40c2ae8>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.624 0.139 1.985
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.condrcat.factor ... ...automatically assigning order attribute to some nodes...
     node W, order:1
     node Cat3, order:2
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0xdbd2148>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.301 0.003 0.312
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.distr ... All custom distributions defined in SimCausal:
    
     [1] "rbern" "rcat.b0" "rcat.b1" "rcat.factor"
     [5] "rcategor" "rcategor.int" "rconst" "rdistr.template"
     Error in rdistr.template(n = 100, arg1 = rep(0.5, 100), arg2 = rep(0.3, :
     inputs arguments should all have the same length
     done successfully.
    
    
    
     Executing test function test.experimental_parsingMSMs ... Error in simcausal:::parse.MSMform(msm.form = msm.form_3_error, t_vec = t_vec, :
     unable to map some of S() expressions in MSM formula, check that all of the summary measure expressions have been previously defined
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     for df_full in long format new summary measures cannot be calculated, using whatever summary measures already exist in df_full
     for df_full in long format outcome is pooled over the same t vector as defined in the first MSM that generated the long format data, changing pooling t requires re-generating the full data
     assuming the data is based on the following map of MSM terms to variable names
     S_exprs_vec XMSMterms
     1 A1[max(0, t - 2)] XMSMterm.4
     MSM: fitting glm to full data
     for df_full in long format new summary measures cannot be calculated, using whatever summary measures already exist in df_full
     for df_full in long format outcome is pooled over the same t vector as defined in the first MSM that generated the long format data, changing pooling t requires re-generating the full data
     assuming the data is based on the following map of MSM terms to variable names
     S_exprs_vec XMSMterms
     1 A1[max(0, t - 2)] XMSMterm.4
     2 A1[max(0, t - 1)] XMSMterm.1
     MSM: fitting glm to full data
     Error in parse.MSMform(msm.form = form, t_vec = t_vec, old.DAG = DAG, :
     unable to map some of S() expressions in MSM formula, check that all of the summary measure expressions have been previously defined
     done successfully.
    
    
    
     Executing test function test.faster_tolongdata ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.latent ... ...automatically assigning order attribute to some nodes...
     node I, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     node U.Y, order:6
     node Y, order:7
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D, latent.v = c("I", "U.Y"))
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0xcec8308>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.026 0 0.026
     Error in set.DAG(D, latent.v = c("I", "U.Y")) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.longparse ... ...automatically assigning order attribute to some nodes...
     node group, order:1
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D2)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0xc02f090>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.02 0 0.021
     Error in set.DAG(D2) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.node ... ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     node L2, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     existing node W1 was modified
     existing node W2 was modified
     existing node W3 was modified
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L1_0, order:1
     node L2_0, order:2
     Error in add.nodes(DAG = obj1, nodes = obj2) :
     cannot define nodes with missing t after nodes with t non-missing were already defined
     In addition: Warning message:
     In rcat.b1(n = n, probs = probs) :
     some categorical probabilities add up to more than 1, normalizing to add to 1
     existing node L1_3 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     ...automatically assigning order attribute to some nodes...
     node L1_0, order:1
     node L2_0, order:2
     node L1_1, order:3
     node L2_1, order:4
     node L1_2, order:5
     node L2_2, order:6
     node L1_3, order:7
     node L2_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L1_5, order:11
     node L2_5, order:12
     simulating observed dataset from the DAG object
     existing node L1_2 was modified
     existing node L1_3 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     ...automatically assigning order attribute to some nodes...
     node L3_0, order:1
     node L3_1, order:2
     node L1_2, order:3
     node L2_2, order:4
     node L3_2, order:5
     node L1_3, order:6
     node L2_3, order:7
     node L3_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L3_4, order:11
     node L1_5, order:12
     node L2_5, order:13
     node L3_5, order:14
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L3_0, order:1
     node L3_1, order:2
     node L1_2, order:3
     node L2_2, order:4
     node L3_2, order:5
     node L1_3, order:6
     node L2_3, order:7
     node L3_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L3_4, order:11
     node L1_5, order:12
     node L2_5, order:13
     node L3_5, order:14
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node A2_0, order:4
     node Y_0, order:5
     node L2_1, order:6
     node A1_1, order:7
     node A2_1, order:8
     node Y_1, order:9
     node L2_2, order:10
     node A1_2, order:11
     node A2_2, order:12
     node Y_2, order:13
     node L2_3, order:14
     node A1_3, order:15
     node A2_3, order:16
     node Y_3, order:17
     node L2_4, order:18
     node A1_4, order:19
     node A2_4, order:20
     node Y_4, order:21
     node L2_5, order:22
     node A1_5, order:23
     node A2_5, order:24
     node Y_5, order:25
     node L2_6, order:26
     node A1_6, order:27
     node A2_6, order:28
     node Y_6, order:29
     node L2_7, order:30
     node A1_7, order:31
     node A2_7, order:32
     node Y_7, order:33
     node L2_8, order:34
     node A1_8, order:35
     node A2_8, order:36
     node Y_8, order:37
     node L2_9, order:38
     node A1_9, order:39
     node A2_9, order:40
     node Y_9, order:41
     node L2_10, order:42
     node A1_10, order:43
     node A2_10, order:44
     node Y_10, order:45
     node L2_11, order:46
     node A1_11, order:47
     node A2_11, order:48
     node Y_11, order:49
     node L2_12, order:50
     node A1_12, order:51
     node A2_12, order:52
     node Y_12, order:53
     node L2_13, order:54
     node A1_13, order:55
     node A2_13, order:56
     node Y_13, order:57
     node L2_14, order:58
     node A1_14, order:59
     node A2_14, order:60
     node Y_14, order:61
     node L2_15, order:62
     node A1_15, order:63
     node A2_15, order:64
     node Y_15, order:65
     node L2_16, order:66
     node A1_16, order:67
     node A2_16, order:68
     node Y_16, order:69
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.noexistdistr ... ...automatically assigning order attribute to some nodes...
     node W1, order:1
     rbinom2: note this distribution could not be located in package namespace, simulating from user-defined distribution found under the same name
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0x11bacc38>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.02 0.005 0.025
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.plotting ... ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node A2_0, order:4
     node Y_0, order:5
     node L2_1, order:6
     node A1_1, order:7
     node A2_1, order:8
     node Y_1, order:9
     node L2_2, order:10
     node A1_2, order:11
     node A2_2, order:12
     node Y_2, order:13
     node L2_3, order:14
     node A1_3, order:15
     node A2_3, order:16
     node Y_3, order:17
     node L2_4, order:18
     node A1_4, order:19
     node A2_4, order:20
     node Y_4, order:21
     node L2_5, order:22
     node A1_5, order:23
     node A2_5, order:24
     node Y_5, order:25
     node L2_6, order:26
     node A1_6, order:27
     node A2_6, order:28
     node Y_6, order:29
     node L2_7, order:30
     node A1_7, order:31
     node A2_7, order:32
     node Y_7, order:33
     node L2_8, order:34
     node A1_8, order:35
     node A2_8, order:36
     node Y_8, order:37
     node L2_9, order:38
     node A1_9, order:39
     node A2_9, order:40
     node Y_9, order:41
     node L2_10, order:42
     node A1_10, order:43
     node A2_10, order:44
     node Y_10, order:45
     node L2_11, order:46
     node A1_11, order:47
     node A2_11, order:48
     node Y_11, order:49
     node L2_12, order:50
     node A1_12, order:51
     node A2_12, order:52
     node Y_12, order:53
     node L2_13, order:54
     node A1_13, order:55
     node A2_13, order:56
     node Y_13, order:57
     node L2_14, order:58
     node A1_14, order:59
     node A2_14, order:60
     node Y_14, order:61
     node L2_15, order:62
     node A1_15, order:63
     node A2_15, order:64
     node Y_15, order:65
     node L2_16, order:66
     node A1_16, order:67
     node A2_16, order:68
     node Y_16, order:69
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG1 ... simulating observed dataset from the DAG object
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG2_errors ... Error in node("A_2", distr = "rbern", prob = 0.5, order = 1) :
     node names with underscore character '_' are not allowed
     Error in L2[0] : undefined time-dependent variable(s): L2_0
     Error : error while evaluating node L2_0 formula:
     ifelse(L2[0] == 1, 0.5, 0.1).
     Check syntax specification.
     Error in set.DAG(c(L2_0, L1_0)) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node , order:1
     node , order:2
     node , order:3
     node , order:4
     Error in strsplit(cur.node$name, "_") : non-character argument
     Error in set.DAG(testDAG_2_err1a) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node , order:1
     node , order:2
     node , order:3
     node , order:4
     node , order:5
     Error in set.DAG(testDAG_2_err1b) :
     All DAG nodes must have unique name attributes
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG2b_newactions ... ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     node A, order:4
     node Y, order:5
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     node A, order:4
     node Y, order:5
     ...automatically assigning order attribute to some nodes...
     node W1_0, order:1
     node W2_0, order:2
     node W3_0, order:3
     node A_0, order:4
     node Y_0, order:5
     node W1_1, order:6
     node W2_1, order:7
     node W3_1, order:8
     node A_1, order:9
     node Y_1, order:10
     ...automatically assigning order attribute to some nodes...
     node W1_0, order:1
     node W2_0, order:2
     node W3_0, order:3
     node A_0, order:4
     node Y_0, order:5
     node W1_1, order:6
     node W2_1, order:7
     node W3_1, order:8
     node A_1, order:9
     node Y_1, order:10
     simulating observed dataset from the DAG object
     using the following vertex attributes:
     NAdarkbluenone100.50
     using the following edge attributes:
     black0.210.60.5
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     Error : n is not a count (a single positive integer)
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     Error in getactions(DAG, actions) :
     Couldn't locate action: A4 , first define action by adding it to the DAG object with DAG+action
     In addition: There were 13 warnings (use warnings() to see them)
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     user system elapsed
     0.581 0.000 0.598
     simulating observed dataset from the DAG object
     user system elapsed
     0.586 0.017 0.673
     simulating observed dataset from the DAG object
     user system elapsed
     0.606 0.001 0.647
     Error in X_dat_th0[[2]] : subscript out of bounds
     In addition: There were 11 warnings (use warnings() to see them)
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     Error in eval.target(D, n = 500, actions = "A1_th1", rndseed = 123) :
     some of the actions in param argument could not be found in the simulated full data
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG3_wlong ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG_informcens ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_general ... Error in set.DAG(testDAG_listobj1) : DAG must be a list
     In addition: Warning messages:
     1: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type == :
     prediction from a rank-deficient fit may be misleading
     2: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type == :
     prediction from a rank-deficient fit may be misleading
     Error in set.DAG(testDAG_listobj2) :
     each of DAG items must be a list specifying DAG node(s)
     ...automatically assigning order attribute to some nodes...
     node nm, order:1
     node nm, order:2
     node nm, order:3
     Error : !is.null(user.env) is not TRUE
     Error in set.DAG(testDAG_names1) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node nm, order:2
     node nm, order:3
     Error : !is.null(user.env) is not TRUE
     Error in set.DAG(testDAG_names2) :
     ...attempt to simulate data from DAG failed...
     Error in set.DAG(testDAG_dist) :
     All DAG nodes must have unique name attributes
     done successfully.
    
    
    
     Executing test function test.substitute ... ...automatically assigning order attribute to some nodes...
     node I, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0x162bd930>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.028 0.004 0.033
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.t.error ... Error in add.nodes(DAG = obj1, nodes = obj2) :
     cannot define nodes with missing t after nodes with t non-missing were already defined
     done successfully.
    
    
    
     Executing test function test.tswitch_2MSMs ... [1] 0
     [1] "abar"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 3
     [1] "abar"
     [1] 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 6
     [1] "abar"
     [1] 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1
     [1] 10
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
     [1] 13
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
     [1] 17
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "tswitch_i"
     [1] 0
     [1] "meanExposureVec"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "tswitch_i"
     [1] 3
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.250 0.400 0.500 0.571 0.625 0.667 0.700 0.727 0.750
     [13] 0.769 0.786 0.800 0.812 0.824
     [1] "tswitch_i"
     [1] 6
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.143 0.250 0.333 0.400 0.455 0.500
     [13] 0.538 0.571 0.600 0.625 0.647
     [1] "tswitch_i"
     [1] 10
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.091 0.167
     [13] 0.231 0.286 0.333 0.375 0.412
     [1] "tswitch_i"
     [1] 13
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
     [13] 0.000 0.071 0.133 0.188 0.235
     [1] "tswitch_i"
     [1] 17
     [1] "meanExposureVec"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] 0
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 5
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.2857143
     [8] 0.3750000 0.4444444 0.5000000 0.5454545 0.5833333 0.6153846 0.6428571
     [15] 0.6666667 0.6875000 0.7058824
     [1] 10
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] 17
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 200 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.2857143
     [8] 0.3750000 0.4444444 0.5000000 0.5454545 0.5833333 0.6153846 0.6428571
     [15] 0.6666667 0.6875000 0.7058824
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     done successfully.
    
    
    
     Executing test function test.long.wide.simobs ... done successfully.
    
    
    
     Executing test function test.networkgen1 ... [1] "automatic Kmax: "
     [1] 1
     [1] "NetInd_k"
     [,1]
     [1,] NA
     [2,] NA
     [3,] 10
     [4,] NA
     [5,] 2
     [6,] 2
     existing node Net.sample was modified
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 2
     [1] "NetInd_k"
     [,1] [,2]
     [1,] NA NA
     [2,] 5 8
     [3,] 5 NA
     [4,] NA NA
     [5,] 3 9
     [6,] 4 9
     existing node Net.sample was modified
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 2
     [1] "NetInd_k"
     [,1] [,2]
     [1,] NA NA
     [2,] 1 8
     [3,] NA NA
     [4,] 3 NA
     [5,] 8 NA
     [6,] 8 NA
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 2
     [1] "NetInd_k"
     [,1] [,2]
     [1,] 2 10
     [2,] NA NA
     [3,] 2 7
     [4,] 9 NA
     [5,] 2 NA
     [6,] 3 NA
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0x10a9cf38>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.976 0.12 2.394
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.networkgen2 ... ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0x164b5020>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.075 0 0.074
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.networkgen_time ... Error in W2[[0]] : variable W2 doesn't exist
     Error : error while evaluating node F.W2_0 formula:
     W2[[0]].
     Check syntax specification.
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error in F.W1[0:1][[0]] :
     ...network indexing variable evaluated to more than one column ...
     Error : error while evaluating node F.W1_2 formula:
     F.W1[0:1][[0]].
     Check syntax specification.
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error : Undefined variable: F.A
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.tKmaxnet ... Error in eval.nodeform.full(expr_call = expr_call, expr_str = expr_str, :
     reference A[...] at node B is not allowed; node A was defined as time-invariant
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     Error : Undefined variable: xyz
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     Error in eval.nodeform.full(expr_call = expr_call, expr_str = expr_str, :
     reference A[...] at node B is not allowed; node A was defined as time-invariant
     In addition: Warning message:
     In FUN(X[[i]], ...) : the argument inside [...] cannot be parsed: A[rnorm]
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.MV ... Loading required package: mvtnorm
     ...automatically assigning order attribute to some nodes...
     node X1.X2.X3, order:1
     node Y1.Y2, order:2
     node A, order:3
     Loading required package: copula
    
     Attaching package: 'copula'
    
     The following object is masked from 'package:simcausal':
    
     A
    
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     [1] "current list of user-defined vectorized functions: qbinom"
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x41a73b8>
     <environment: 0x176a9600>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.107 0.067 1.323
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.NSEbug ... [1] "s"
     [1] 1
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     existing node L1_0 was modified
     [1] "s"
     [1] 3
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     existing node L1_0 was modified
     [1] "s"
     [1] 1
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     existing node L1_2 was modified
     [1] "s"
     [1] 2
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     done successfully.
    
     ------------------- UNIT TEST SUMMARY ---------------------
    
     RUNIT TEST PROTOCOL -- Sun Feb 16 00:06:24 2020
     ***********************************************
     Number of test functions: 28
     Number of errors: 9
     Number of failures: 0
    
    
     1 Test Suite :
     simcausal unit testing - 28 test functions, 9 errors, 0 failures
     ERROR in test.bugfixes: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.condrcat.factor: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.latent: Error in set.DAG(D, latent.v = c("I", "U.Y")) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.longparse: Error in set.DAG(D2) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.noexistdistr: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.substitute: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.networkgen1: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.networkgen2: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.MV: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error:
    
     unit testing failed (#test failures: 0, #R errors: 9)
    
     Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 0.5.5
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
    --- re-building ‘simcausal_vignette.Rnw’ using knitr
    ...automatically assigning order attribute to some nodes...
    node race, order:1
    node W1, order:2
    node W2, order:3
    node W3, order:4
    node Anode, order:5
    node Y, order:6
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    simcausal
     --- call from context ---
    standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
    if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
    } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
    } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
    } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
    }
     --- R stacktrace ---
    where 1: standardize_param(newNodeParams$dist_params[[idx]])
    where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
    where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
    where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
    where 10: set.DAG(D)
    where 11: eval(expr, envir, enclos)
    where 12: eval(expr, envir, enclos)
    where 13: withVisible(eval(expr, envir, enclos))
    where 14: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 15: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 16: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 17: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 18: evaluate::evaluate(...)
    where 19: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 20: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 21: block_exec(params)
    where 22: call_block(x)
    where 23: process_group.block(group)
    where 24: process_group(group)
    where 25: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 26: process_file(text, output)
    where 27: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$",
     file)) knit2pandoc else knit)(file, encoding = encoding,
     quiet = quiet, envir = globalenv(), ...)
    where 28: engine$weave(file, quiet = quiet, encoding = enc)
    where 29: doTryCatch(return(expr), name, parentenv, handler)
    where 30: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 31: tryCatchList(expr, classes, parentenv, handlers)
    where 32: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 33: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-clang/simcausal.Rcheck/vign_test/simcausal",
     ser_elibs = "/tmp/RtmpNHkmnR/file56d93f9a5675.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (distparam)
    {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
    }
    <bytecode: 0x1863100>
    <environment: 0x2ecf2f0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Quitting from lines 912-935 (simcausal_vignette.Rnw)
    Error: processing vignette 'simcausal_vignette.Rnw' failed with diagnostics:
    
    ...attempt to simulate data from DAG failed...
    --- failed re-building ‘simcausal_vignette.Rnw’
    
    SUMMARY: processing the following file failed:
     ‘simcausal_vignette.Rnw’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 0.5.5
Check: examples
Result: ERROR
    Running examples in ‘simcausal-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: network
    > ### Title: Define a Network Generator
    > ### Aliases: network
    >
    > ### ** Examples
    >
    > #--------------------------------------------------------------------------------------------------
    > # EXAMPLE 1. USING igraph R PACKAGE TO SIMULATE NETWORKS
    > #--------------------------------------------------------------------------------------------------
    >
    > #--------------------------------------------------------------------------------------------------
    > # Example of a network sampler, will be provided as "netfun" argument to network(, netfun=);
    > # Generates a random graph according to the G(n,m) Erdos-Renyi model using the igraph package;
    > # Returns (n,Kmax) matrix of net IDs (friends) by row;
    > # Row i contains the IDs (row numbers) of i's friends;
    > # i's friends are assumed connected to i and can influence i in equations defined by node())
    > # When i has less than Kmax friends, the remaining i row entries are filled with NAs;
    > # Argument m_pn: > 0
    > # a total number of edges in the network as a fraction (or multiplier) of n (sample size)
    > #--------------------------------------------------------------------------------------------------
    > gen.ER <- function(n, m_pn, ...) {
    + m <- as.integer(m_pn*n)
    + if (n<=10) m <- 20
    + igraph.ER <- igraph::sample_gnm(n = n, m = m, directed = TRUE)
    + sparse_AdjMat <- igraph.to.sparseAdjMat(igraph.ER)
    + NetInd_out <- sparseAdjMat.to.NetInd(sparse_AdjMat)
    + return(NetInd_out$NetInd_k)
    + }
    >
    > D <- DAG.empty()
    > # Sample ER model network using igraph::sample_gnm with m_pn argument:
    > D <- D + network("ER.net", netfun = "gen.ER", m_pn = 50)
    > # W1 - categorical (6 categories, 1-6):
    > D <- D +
    + node("W1", distr = "rcat.b1",
    + probs = c(0.0494, 0.1823, 0.2806, 0.2680, 0.1651, 0.0546)) +
    + # W2 - binary infection status, positively correlated with W1:
    + node("W2", distr = "rbern", prob = plogis(-0.2 + W1/3)) +
    + # W3 - binary confounder:
    + node("W3", distr = "rbern", prob = 0.6)
    > # A[i] is a function W1[i] and the total of i's friends values W1, W2 and W3:
    > D <- D + node("A", distr = "rbern",
    + prob = plogis(2 + -0.5 * W1 +
    + -0.1 * sum(W1[[1:Kmax]]) +
    + -0.4 * sum(W2[[1:Kmax]]) +
    + -0.7 * sum(W3[[1:Kmax]])),
    + replaceNAw0 = TRUE)
    > # Y[i] is a function of netW3 (friends of i W3 values) and the total N of i's friends
    > # who are infected AND untreated:
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 2 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    > # Can add N untreated friends to the above outcome Y equation: sum(1 - A[[1:Kmax]]):
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 1.5 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]]) +
    + 0.25 * sum(1 - A[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    existing node Y was modified
    > # Can add N infected friends at baseline to the above outcome Y equation: sum(W2[[1:Kmax]]):
    > D <- D + node("Y", distr = "rbern",
    + prob = plogis(-1 + 1 * sum(W2[[1:Kmax]] * (1 - A[[1:Kmax]])) +
    + -2 * sum(W3[[1:Kmax]]) +
    + 0.25 * sum(1 - A[[1:Kmax]]) +
    + 0.25 * sum(W2[[1:Kmax]])
    + ),
    + replaceNAw0 = TRUE)
    existing node Y was modified
    > Dset <- set.DAG(D, n.test = 100)
    ...automatically assigning order attribute to some nodes...
    node ER.net, order:1
    node W1, order:2
    node W2, order:3
    node W3, order:4
    node A, order:5
    node Y, order:6
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    simcausal
     --- call from context ---
    standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
    if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
    } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
    } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
    } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
    }
     --- R stacktrace ---
    where 1: standardize_param(newNodeParams$dist_params[[idx]])
    where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
    where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
    where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
    where 10: set.DAG(D, n.test = 100)
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (distparam)
    {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
    }
    <bytecode: 0x1df5ad0>
    <environment: 0xaca23a0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
    Error in set.DAG(D, n.test = 100) :
    ...attempt to simulate data from DAG failed...
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc

Version: 0.5.5
Check: tests
Result: ERROR
     Running ‘test-all.R’ [140s/163s]
    Running the tests in ‘tests/test-all.R’ failed.
    Complete output:
     > ## unit tests will not be done if RUnit is not available
     > # setwd("..")
     > # getwd()
     > # library(RUnit)
     > if(require("RUnit", quietly=TRUE)) {
     + ## --- Setup ---
     +
     + pkg <- "simcausal" # <-- Tested 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(), "..", "inst", "unitTests")
     + } else {
     + ## Path to unit tests for R CMD check
     + ## PKG.Rcheck/tests/../PKG/unitTests
     + # path <- system.file(package=pkg, "RUnit")
     +
     + # REPLACED WITH:
     + path <- file.path(getwd(), "RUnit")
     + }
     +
     + 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
     + test.suite <- defineTestSuite(name=paste(pkg, "unit testing"),
     + # dirs="./RUnit",
     + dirs=path,
     + testFileRegexp = "^RUnit_tests_+",
     + testFuncRegexp = "^test.+",
     + rngKind = "Marsaglia-Multicarry",
     + rngNormalKind = "Kinderman-Ramage")
     + ## Run
     + tests <- runTestSuite(test.suite)
     +
     + ## Default report name
     + pathReport <- file.path(path, "report")
     +
     + ## Report to stdout and text files
     + cat("------------------- UNIT TEST SUMMARY ---------------------\n\n")
     + printTextProtocol(tests, showDetails=FALSE)
     + printTextProtocol(tests, showDetails=FALSE,
     + fileName=paste0(pathReport, "Summary.txt"))
     + printTextProtocol(tests, showDetails=TRUE,
     + fileName=paste0(pathReport, ".txt"))
     + ## Report to HTML file
     + printHTMLProtocol(tests, fileName=paste0(pathReport, ".html"))
     +
     + ## 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] "simcausal"
    
     $getwd
     [1] "/data/gannet/ripley/R/packages/tests-devel/simcausal.Rcheck/tests"
    
     $pathToUnitTests
     [1] "/data/gannet/ripley/R/packages/tests-devel/simcausal.Rcheck/tests/RUnit"
    
    
    
     Executing test function test.EFUeval ... ...automatically assigning order attribute to some nodes...
     node C.time_0, order:1
     node Y_0, order:2
     node D_0, order:3
     node C.time_1, order:4
     node Y_1, order:5
     node D_1, order:6
     node C.time_2, order:7
     node Y_2, order:8
     node D_2, order:9
     node C.time_3, order:10
     node Y_3, order:11
     node D_3, order:12
     node C.time_4, order:13
     node Y_4, order:14
     node D_4, order:15
     node C.time_5, order:16
     node Y_5, order:17
     node D_5, order:18
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node C.time_0, order:1
     node Y_0, order:2
     node D_0, order:3
     node C.time_1, order:4
     node Y_1, order:5
     node D_1, order:6
     node C.time_2, order:7
     node Y_2, order:8
     node D_2, order:9
     node C.time_3, order:10
     node Y_3, order:11
     node D_3, order:12
     node C.time_4, order:13
     node Y_4, order:14
     node D_4, order:15
     node C.time_5, order:16
     node Y_5, order:17
     node D_5, order:18
     using the following vertex attributes:
     NAdarkbluenone70.50
     using the following edge attributes:
     black0.210.30.2
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.Nsamp.n.test ... ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node A, order:1
     node N, order:2
     done successfully.
    
    
    
     Executing test function test.bugfixes ... ...automatically assigning order attribute to some nodes...
     node const, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     node Y, order:6
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node L2_1, order:5
     node L2_2, order:6
     node L2_3, order:7
     node L2_4, order:8
     node L2_5, order:9
     node L2_6, order:10
     node L2_7, order:11
     node L2_8, order:12
     node L2_9, order:13
     node L2_10, order:14
     node L2_11, order:15
     node L2_12, order:16
     node L2_13, order:17
     node L2_14, order:18
     node L2_15, order:19
     node L2_16, order:20
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node L2_1, order:3
     node L1_1, order:4
     node L2_2, order:5
     node L1_2, order:6
     node L2_3, order:7
     node L1_3, order:8
     node L2_4, order:9
     node L1_4, order:10
     node L2_5, order:11
     node L1_5, order:12
     node L2_6, order:13
     node L1_6, order:14
     node L2_7, order:15
     node L1_7, order:16
     node L2_8, order:17
     node L1_8, order:18
     node L2_9, order:19
     node L1_9, order:20
     node L2_10, order:21
     node L1_10, order:22
     node L2_11, order:23
     node L1_11, order:24
     node L2_12, order:25
     node L1_12, order:26
     node L2_13, order:27
     node L1_13, order:28
     node L2_14, order:29
     node L1_14, order:30
     node L2_15, order:31
     node L1_15, order:32
     node L2_16, order:33
     node L1_16, order:34
     Error in add.nodes(DAG = obj1, nodes = obj2) :
     DAG object is locked: nodes in this DAG cannot be modified or added after set.DAG()
     In addition: Warning messages:
     1: In add.nodes(DAG = obj1, nodes = obj2) :
     existing non-time-varying node L2 was overwritten with a time-varying node
     2: In add.nodes(DAG = obj1, nodes = obj2) :
     existing non-time-varying node L2 was overwritten with a time-varying node
     3: In set.DAG(D) :
     trying to lock an empty DAG, add nodes before calling set.DAG()
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0x38c6218>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.65 0.147 2.23
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.condrcat.factor ... ...automatically assigning order attribute to some nodes...
     node W, order:1
     node Cat3, order:2
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0xd356508>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.326 0.001 0.54
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.distr ... All custom distributions defined in SimCausal:
    
     [1] "rbern" "rcat.b0" "rcat.b1" "rcat.factor"
     [5] "rcategor" "rcategor.int" "rconst" "rdistr.template"
     Error in rdistr.template(n = 100, arg1 = rep(0.5, 100), arg2 = rep(0.3, :
     inputs arguments should all have the same length
     done successfully.
    
    
    
     Executing test function test.experimental_parsingMSMs ... Error in simcausal:::parse.MSMform(msm.form = msm.form_3_error, t_vec = t_vec, :
     unable to map some of S() expressions in MSM formula, check that all of the summary measure expressions have been previously defined
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating action-specific datasets for action(s): A1_th0 A1_th1
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     for df_full in long format new summary measures cannot be calculated, using whatever summary measures already exist in df_full
     for df_full in long format outcome is pooled over the same t vector as defined in the first MSM that generated the long format data, changing pooling t requires re-generating the full data
     assuming the data is based on the following map of MSM terms to variable names
     S_exprs_vec XMSMterms
     1 A1[max(0, t - 2)] XMSMterm.4
     MSM: fitting glm to full data
     for df_full in long format new summary measures cannot be calculated, using whatever summary measures already exist in df_full
     for df_full in long format outcome is pooled over the same t vector as defined in the first MSM that generated the long format data, changing pooling t requires re-generating the full data
     assuming the data is based on the following map of MSM terms to variable names
     S_exprs_vec XMSMterms
     1 A1[max(0, t - 2)] XMSMterm.4
     2 A1[max(0, t - 1)] XMSMterm.1
     MSM: fitting glm to full data
     Error in parse.MSMform(msm.form = form, t_vec = t_vec, old.DAG = DAG, :
     unable to map some of S() expressions in MSM formula, check that all of the summary measure expressions have been previously defined
     done successfully.
    
    
    
     Executing test function test.faster_tolongdata ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.latent ... ...automatically assigning order attribute to some nodes...
     node I, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     node U.Y, order:6
     node Y, order:7
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D, latent.v = c("I", "U.Y"))
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0xc64ca08>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.027 0.002 0.029
     Error in set.DAG(D, latent.v = c("I", "U.Y")) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.longparse ... ...automatically assigning order attribute to some nodes...
     node group, order:1
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D2)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0x9d449f0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.023 0 0.024
     Error in set.DAG(D2) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.node ... ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L0, order:1
     node L1, order:2
     node L2, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     existing node W1 was modified
     existing node W2 was modified
     existing node W3 was modified
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L1_0, order:1
     node L2_0, order:2
     Error in add.nodes(DAG = obj1, nodes = obj2) :
     cannot define nodes with missing t after nodes with t non-missing were already defined
     In addition: Warning message:
     In rcat.b1(n = n, probs = probs) :
     some categorical probabilities add up to more than 1, normalizing to add to 1
     existing node L1_3 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     ...automatically assigning order attribute to some nodes...
     node L1_0, order:1
     node L2_0, order:2
     node L1_1, order:3
     node L2_1, order:4
     node L1_2, order:5
     node L2_2, order:6
     node L1_3, order:7
     node L2_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L1_5, order:11
     node L2_5, order:12
     simulating observed dataset from the DAG object
     existing node L1_2 was modified
     existing node L1_3 was modified
     existing node L1_4 was modified
     existing node L1_5 was modified
     ...automatically assigning order attribute to some nodes...
     node L3_0, order:1
     node L3_1, order:2
     node L1_2, order:3
     node L2_2, order:4
     node L3_2, order:5
     node L1_3, order:6
     node L2_3, order:7
     node L3_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L3_4, order:11
     node L1_5, order:12
     node L2_5, order:13
     node L3_5, order:14
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L3_0, order:1
     node L3_1, order:2
     node L1_2, order:3
     node L2_2, order:4
     node L3_2, order:5
     node L1_3, order:6
     node L2_3, order:7
     node L3_3, order:8
     node L1_4, order:9
     node L2_4, order:10
     node L3_4, order:11
     node L1_5, order:12
     node L2_5, order:13
     node L3_5, order:14
     simulating observed dataset from the DAG object
     ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node A2_0, order:4
     node Y_0, order:5
     node L2_1, order:6
     node A1_1, order:7
     node A2_1, order:8
     node Y_1, order:9
     node L2_2, order:10
     node A1_2, order:11
     node A2_2, order:12
     node Y_2, order:13
     node L2_3, order:14
     node A1_3, order:15
     node A2_3, order:16
     node Y_3, order:17
     node L2_4, order:18
     node A1_4, order:19
     node A2_4, order:20
     node Y_4, order:21
     node L2_5, order:22
     node A1_5, order:23
     node A2_5, order:24
     node Y_5, order:25
     node L2_6, order:26
     node A1_6, order:27
     node A2_6, order:28
     node Y_6, order:29
     node L2_7, order:30
     node A1_7, order:31
     node A2_7, order:32
     node Y_7, order:33
     node L2_8, order:34
     node A1_8, order:35
     node A2_8, order:36
     node Y_8, order:37
     node L2_9, order:38
     node A1_9, order:39
     node A2_9, order:40
     node Y_9, order:41
     node L2_10, order:42
     node A1_10, order:43
     node A2_10, order:44
     node Y_10, order:45
     node L2_11, order:46
     node A1_11, order:47
     node A2_11, order:48
     node Y_11, order:49
     node L2_12, order:50
     node A1_12, order:51
     node A2_12, order:52
     node Y_12, order:53
     node L2_13, order:54
     node A1_13, order:55
     node A2_13, order:56
     node Y_13, order:57
     node L2_14, order:58
     node A1_14, order:59
     node A2_14, order:60
     node Y_14, order:61
     node L2_15, order:62
     node A1_15, order:63
     node A2_15, order:64
     node Y_15, order:65
     node L2_16, order:66
     node A1_16, order:67
     node A2_16, order:68
     node Y_16, order:69
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.noexistdistr ... ...automatically assigning order attribute to some nodes...
     node W1, order:1
     rbinom2: note this distribution could not be located in package namespace, simulating from user-defined distribution found under the same name
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0x12b59790>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.019 0.002 0.021
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.plotting ... ...automatically assigning order attribute to some nodes...
     node L2_0, order:1
     node L1_0, order:2
     node A1_0, order:3
     node A2_0, order:4
     node Y_0, order:5
     node L2_1, order:6
     node A1_1, order:7
     node A2_1, order:8
     node Y_1, order:9
     node L2_2, order:10
     node A1_2, order:11
     node A2_2, order:12
     node Y_2, order:13
     node L2_3, order:14
     node A1_3, order:15
     node A2_3, order:16
     node Y_3, order:17
     node L2_4, order:18
     node A1_4, order:19
     node A2_4, order:20
     node Y_4, order:21
     node L2_5, order:22
     node A1_5, order:23
     node A2_5, order:24
     node Y_5, order:25
     node L2_6, order:26
     node A1_6, order:27
     node A2_6, order:28
     node Y_6, order:29
     node L2_7, order:30
     node A1_7, order:31
     node A2_7, order:32
     node Y_7, order:33
     node L2_8, order:34
     node A1_8, order:35
     node A2_8, order:36
     node Y_8, order:37
     node L2_9, order:38
     node A1_9, order:39
     node A2_9, order:40
     node Y_9, order:41
     node L2_10, order:42
     node A1_10, order:43
     node A2_10, order:44
     node Y_10, order:45
     node L2_11, order:46
     node A1_11, order:47
     node A2_11, order:48
     node Y_11, order:49
     node L2_12, order:50
     node A1_12, order:51
     node A2_12, order:52
     node Y_12, order:53
     node L2_13, order:54
     node A1_13, order:55
     node A2_13, order:56
     node Y_13, order:57
     node L2_14, order:58
     node A1_14, order:59
     node A2_14, order:60
     node Y_14, order:61
     node L2_15, order:62
     node A1_15, order:63
     node A2_15, order:64
     node Y_15, order:65
     node L2_16, order:66
     node A1_16, order:67
     node A2_16, order:68
     node Y_16, order:69
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG1 ... simulating observed dataset from the DAG object
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG2_errors ... Error in node("A_2", distr = "rbern", prob = 0.5, order = 1) :
     node names with underscore character '_' are not allowed
     Error in L2[0] : undefined time-dependent variable(s): L2_0
     Error : error while evaluating node L2_0 formula:
     ifelse(L2[0] == 1, 0.5, 0.1).
     Check syntax specification.
     Error in set.DAG(c(L2_0, L1_0)) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node , order:1
     node , order:2
     node , order:3
     node , order:4
     Error in strsplit(cur.node$name, "_") : non-character argument
     Error in set.DAG(testDAG_2_err1a) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node , order:1
     node , order:2
     node , order:3
     node , order:4
     node , order:5
     Error in set.DAG(testDAG_2_err1b) :
     All DAG nodes must have unique name attributes
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG2b_newactions ... ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     node A, order:4
     node Y, order:5
     ...automatically assigning order attribute to some nodes...
     node W1, order:1
     node W2, order:2
     node W3, order:3
     node A, order:4
     node Y, order:5
     ...automatically assigning order attribute to some nodes...
     node W1_0, order:1
     node W2_0, order:2
     node W3_0, order:3
     node A_0, order:4
     node Y_0, order:5
     node W1_1, order:6
     node W2_1, order:7
     node W3_1, order:8
     node A_1, order:9
     node Y_1, order:10
     ...automatically assigning order attribute to some nodes...
     node W1_0, order:1
     node W2_0, order:2
     node W3_0, order:3
     node A_0, order:4
     node Y_0, order:5
     node W1_1, order:6
     node W2_1, order:7
     node W3_1, order:8
     node A_1, order:9
     node Y_1, order:10
     simulating observed dataset from the DAG object
     using the following vertex attributes:
     NAdarkbluenone100.50
     using the following edge attributes:
     black0.210.60.5
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     Error : n is not a count (a single positive integer)
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     Error in getactions(DAG, actions) :
     Couldn't locate action: A4 , first define action by adding it to the DAG object with DAG+action
     In addition: There were 13 warnings (use warnings() to see them)
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating action-specific datasets for action(s): A1 A0
     simulating action-specific datasets for action(s): A1 A0
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     user system elapsed
     0.569 0.002 0.781
     simulating observed dataset from the DAG object
     user system elapsed
     0.613 0.001 1.243
     simulating observed dataset from the DAG object
     user system elapsed
     0.619 0.000 0.711
     Error in X_dat_th0[[2]] : subscript out of bounds
     In addition: There were 11 warnings (use warnings() to see them)
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     Error in eval.target(D, n = 500, actions = "A1_th1", rndseed = 123) :
     some of the actions in param argument could not be found in the simulated full data
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     data not specified, simulating full data
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG3_wlong ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_DAG_informcens ... simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 100 simulated samples per action
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     some outcome nodes have EFU=TRUE, applying Last Time Point Carry Forward function: doLTCF()
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     simulating observed dataset from the DAG object
     simulating observed dataset from the DAG object
     done successfully.
    
    
    
     Executing test function test.set.DAG_general ... Error in set.DAG(testDAG_listobj1) : DAG must be a list
     In addition: Warning messages:
     1: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type == :
     prediction from a rank-deficient fit may be misleading
     2: In predict.lm(object, newdata, se.fit, scale = 1, type = if (type == :
     prediction from a rank-deficient fit may be misleading
     Error in set.DAG(testDAG_listobj2) :
     each of DAG items must be a list specifying DAG node(s)
     ...automatically assigning order attribute to some nodes...
     node nm, order:1
     node nm, order:2
     node nm, order:3
     Error : !is.null(user.env) is not TRUE
     Error in set.DAG(testDAG_names1) :
     ...attempt to simulate data from DAG failed...
     ...automatically assigning order attribute to some nodes...
     node nm, order:2
     node nm, order:3
     Error : !is.null(user.env) is not TRUE
     Error in set.DAG(testDAG_names2) :
     ...attempt to simulate data from DAG failed...
     Error in set.DAG(testDAG_dist) :
     All DAG nodes must have unique name attributes
     done successfully.
    
    
    
     Executing test function test.substitute ... ...automatically assigning order attribute to some nodes...
     node I, order:1
     node W1, order:2
     node W2, order:3
     node W3, order:4
     node A, order:5
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0xef14708>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.029 0.002 0.031
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.t.error ... Error in add.nodes(DAG = obj1, nodes = obj2) :
     cannot define nodes with missing t after nodes with t non-missing were already defined
     done successfully.
    
    
    
     Executing test function test.tswitch_2MSMs ... [1] 0
     [1] "abar"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 3
     [1] "abar"
     [1] 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 6
     [1] "abar"
     [1] 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1
     [1] 10
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
     [1] 13
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
     [1] 17
     [1] "abar"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "tswitch_i"
     [1] 0
     [1] "meanExposureVec"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "tswitch_i"
     [1] 3
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.250 0.400 0.500 0.571 0.625 0.667 0.700 0.727 0.750
     [13] 0.769 0.786 0.800 0.812 0.824
     [1] "tswitch_i"
     [1] 6
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.143 0.250 0.333 0.400 0.455 0.500
     [13] 0.538 0.571 0.600 0.625 0.647
     [1] "tswitch_i"
     [1] 10
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.091 0.167
     [13] 0.231 0.286 0.333 0.375 0.412
     [1] "tswitch_i"
     [1] 13
     [1] "meanExposureVec"
     [1] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
     [13] 0.000 0.071 0.133 0.188 0.235
     [1] "tswitch_i"
     [1] 17
     [1] "meanExposureVec"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     evaluating MSM summary measures and converting full data to long format for MSM target parameter
     MSM: fitting glm to full data
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 500 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "XMSMterm.1"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.2500000 0.4000000 0.5000000 0.5714286
     [8] 0.6250000 0.6666667 0.7000000 0.7272727 0.7500000 0.7692308 0.7857143
     [15] 0.8000000 0.8125000 0.8235294
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
     [8] 0.2500000 0.3333333 0.4000000 0.4545455 0.5000000 0.5384615 0.5714286
     [15] 0.6000000 0.6250000 0.6470588
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [13] 0.00000000 0.07142857 0.13333333 0.18750000 0.23529412
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     [1] 0
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] 5
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.2857143
     [8] 0.3750000 0.4444444 0.5000000 0.5454545 0.5833333 0.6153846 0.6428571
     [15] 0.6666667 0.6875000 0.7058824
     [1] 10
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] 17
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     data not specified, simulating full data
     no actions specified, sampling full data for ALL actions from the DAG
     evaluating the target on 200 simulated samples per action
     MSM: fitting glm to full data
     [1] "MSMtermName used"
     [1] "meanExposure"
     [1] "MSMterm_vals last"
     [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
     [1] "MSMterm_vals last"
     [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.2857143
     [8] 0.3750000 0.4444444 0.5000000 0.5454545 0.5833333 0.6153846 0.6428571
     [15] 0.6666667 0.6875000 0.7058824
     [1] "MSMterm_vals last"
     [1] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
     [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.09090909 0.16666667
     [13] 0.23076923 0.28571429 0.33333333 0.37500000 0.41176471
     [1] "MSMterm_vals last"
     [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     done successfully.
    
    
    
     Executing test function test.long.wide.simobs ... done successfully.
    
    
    
     Executing test function test.networkgen1 ... [1] "automatic Kmax: "
     [1] 2
     [1] "NetInd_k"
     [,1] [,2]
     [1,] NA NA
     [2,] NA NA
     [3,] 2 9
     [4,] NA NA
     [5,] NA NA
     [6,] 1 NA
     existing node Net.sample was modified
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 3
     [1] "NetInd_k"
     [,1] [,2] [,3]
     [1,] 7 NA NA
     [2,] 3 5 NA
     [3,] NA NA NA
     [4,] NA NA NA
     [5,] 3 4 10
     [6,] 5 7 NA
     existing node Net.sample was modified
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 4
     [1] "NetInd_k"
     [,1] [,2] [,3] [,4]
     [1,] 4 NA NA NA
     [2,] 8 NA NA NA
     [3,] NA NA NA NA
     [4,] NA NA NA NA
     [5,] 1 2 NA NA
     [6,] NA NA NA NA
     simulating network with ER model using m: 10
     [1] "automatic Kmax: "
     [1] 3
     [1] "NetInd_k"
     [,1] [,2] [,3]
     [1,] NA NA NA
     [2,] 7 8 NA
     [3,] 6 7 10
     [4,] NA NA NA
     [5,] NA NA NA
     [6,] NA NA NA
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0x110ad9b0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.932 0.009 3.093
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.networkgen2 ... ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0x11f88f30>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 0.035 0 0.074
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.networkgen_time ... Error in W2[[0]] : variable W2 doesn't exist
     Error : error while evaluating node F.W2_0 formula:
     W2[[0]].
     Check syntax specification.
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error in F.W1[0:1][[0]] :
     ...network indexing variable evaluated to more than one column ...
     Error : error while evaluating node F.W1_2 formula:
     F.W1[0:1][[0]].
     Check syntax specification.
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error : Undefined variable: F.A
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.tKmaxnet ... Error in eval.nodeform.full(expr_call = expr_call, expr_str = expr_str, :
     reference A[...] at node B is not allowed; node A was defined as time-invariant
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     Error : Undefined variable: xyz
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     Error in eval.nodeform.full(expr_call = expr_call, expr_str = expr_str, :
     reference A[...] at node B is not allowed; node A was defined as time-invariant
     In addition: Warning message:
     In FUN(X[[i]], ...) : the argument inside [...] cannot be parsed: A[rnorm]
     Error in set.DAG(D.t) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.MV ... Loading required package: mvtnorm
     ...automatically assigning order attribute to some nodes...
     node X1.X2.X3, order:1
     node Y1.Y2, order:2
     node A, order:3
     Loading required package: copula
    
     Attaching package: 'copula'
    
     The following object is masked from 'package:simcausal':
    
     A
    
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     Don't know the expression result type S4FALSE
     [1] "current list of user-defined vectorized functions: qbinom"
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     simcausal
     --- call from context ---
     standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     --- R stacktrace ---
     where 1: standardize_param(newNodeParams$dist_params[[idx]])
     where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
     where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
     where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
     where 5: doTryCatch(return(expr), name, parentenv, handler)
     where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 7: tryCatchList(expr, classes, parentenv, handlers)
     where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
     where 10: set.DAG(D)
     where 11: func()
     where 12: system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest)
     where 13: doTryCatch(return(expr), name, parentenv, handler)
     where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 15: tryCatchList(expr, classes, parentenv, handlers)
     where 16: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
     })
     where 17: try(system.time(func(), gcFirst = RUnitEnv$.gcBeforeTest))
     where 18: .executeTestCase(funcName, envir = sandbox, setUpFunc = .setUp,
     tearDownFunc = .tearDown)
     where 19: .sourceTestFile(testFile, testSuite$testFuncRegexp)
     where 20: runTestSuite(test.suite)
    
     --- value of length: 2 type: logical ---
     [1] FALSE FALSE
     --- function from context ---
     function (distparam)
     {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
     }
     <bytecode: 0x395f568>
     <environment: 0x1a3e23d0>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
     Error in if (class(distparam) %in% "list") { :
     the condition has length > 1
     Timing stopped at: 1.104 0.029 1.315
     Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     done successfully.
    
    
    
     Executing test function test.NSEbug ... [1] "s"
     [1] 1
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     existing node L1_0 was modified
     [1] "s"
     [1] 3
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 0
     [1] "variable"
     [1] "mse"
     existing node L1_0 was modified
     [1] "s"
     [1] 1
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 1
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 1
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     existing node L1_2 was modified
     [1] "s"
     [1] 2
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 2
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "(Intercept)"
     [1] "s"
     [1] 3
     [1] "t"
     [1] 2
     [1] "variable"
     [1] "mse"
     done successfully.
    
     ------------------- UNIT TEST SUMMARY ---------------------
    
     RUNIT TEST PROTOCOL -- Mon Feb 17 09:58:28 2020
     ***********************************************
     Number of test functions: 28
     Number of errors: 9
     Number of failures: 0
    
    
     1 Test Suite :
     simcausal unit testing - 28 test functions, 9 errors, 0 failures
     ERROR in test.bugfixes: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.condrcat.factor: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.latent: Error in set.DAG(D, latent.v = c("I", "U.Y")) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.longparse: Error in set.DAG(D2) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.noexistdistr: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.substitute: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.networkgen1: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.networkgen2: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     ERROR in test.MV: Error in set.DAG(D) :
     ...attempt to simulate data from DAG failed...
     Error:
    
     unit testing failed (#test failures: 0, #R errors: 9)
    
     Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc

Version: 0.5.5
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
    --- re-building ‘simcausal_vignette.Rnw’ using knitr
    ...automatically assigning order attribute to some nodes...
    node race, order:1
    node W1, order:2
    node W2, order:3
    node W3, order:4
    node Anode, order:5
    node Y, order:6
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    simcausal
     --- call from context ---
    standardize_param(newNodeParams$dist_params[[idx]])
     --- call from argument ---
    if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
    } else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
    } else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
    } else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
    }
     --- R stacktrace ---
    where 1: standardize_param(newNodeParams$dist_params[[idx]])
    where 2: sampleNodeDistr(newNodeParams = newNodeParams, distr = distr,
     EFUP.prev = EFUP.prev, cur.node = cur.node, expr_str = cur.node$dist_params)
    where 3: simFromDAG(DAG = DAG, Nsamp = n, wide = wide, LTCF = LTCF, rndseed = rndseed,
     rndseed.reset.node = rndseed.reset.node, verbose = verbose)
    where 4: simobs(inputDAG, n = n.test, rndseed = rndseed)
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(simobs(inputDAG, n = n.test, rndseed = rndseed))
    where 10: set.DAG(D)
    where 11: eval(expr, envir, enclos)
    where 12: eval(expr, envir, enclos)
    where 13: withVisible(eval(expr, envir, enclos))
    where 14: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler,
     error = eHandler, message = mHandler)
    where 15: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir,
     enclos)), warning = wHandler, error = eHandler, message = mHandler))
    where 16: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr,
     envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
    where 17: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
     debug = debug, last = i == length(out), use_try = stop_on_error !=
     2L, keep_warning = keep_warning, keep_message = keep_message,
     output_handler = output_handler, include_timing = include_timing)
    where 18: evaluate::evaluate(...)
    where 19: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning),
     keep_message = !isFALSE(options$message), stop_on_error = if (options$error &&
     options$include) 0L else 2L, output_handler = knit_handlers(options$render,
     options))
    where 20: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE,
     keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message),
     stop_on_error = if (options$error && options$include) 0L else 2L,
     output_handler = knit_handlers(options$render, options)))
    where 21: block_exec(params)
    where 22: call_block(x)
    where 23: process_group.block(group)
    where 24: process_group(group)
    where 25: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group),
     error = function(e) {
     setwd(wd)
     cat(res, sep = "\n", file = output %n% "")
     message("Quitting from lines ", paste(current_lines(i),
     collapse = "-"), " (", knit_concord$get("infile"),
     ") ")
     })
    where 26: process_file(text, output)
    where 27: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$",
     file)) knit2pandoc else knit)(file, encoding = encoding,
     quiet = quiet, envir = globalenv(), ...)
    where 28: engine$weave(file, quiet = quiet, encoding = enc)
    where 29: doTryCatch(return(expr), name, parentenv, handler)
    where 30: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 31: tryCatchList(expr, classes, parentenv, handlers)
    where 32: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 33: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-devel/simcausal.Rcheck/vign_test/simcausal",
     ser_elibs = "/tmp/RtmpsFQEey/file79d42a95e670.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE FALSE
     --- function from context ---
    function (distparam)
    {
     check_len <- function(param) {
     len <- length(param)
     if (len == 1) {
     param <- rep.int(param, N_notNA_samp)
     }
     else if (len == Nsamp) {
     param <- param[!EFUP.prev]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): " %+% expr_str %+% ".\n One of the distribution parameters evaluated to non-standard vector length (its neither 1 nor n), make sure the distribution function knows how to handle it.")
     }
     param
     }
     if (class(distparam) %in% "list") {
     distparam <- lapply(distparam, check_len)
     distparam <- do.call("cbind", distparam)
     }
     else if (is.vector(distparam)) {
     distparam <- check_len(distparam)
     }
     else if (is.matrix(distparam)) {
     if (nrow(distparam) == 1) {
     }
     else if (nrow(distparam) == Nsamp) {
     distparam <- distparam[!EFUP.prev, , drop = FALSE]
     }
     else {
     if (verbose)
     message("evaluating node " %+% cur.node$name %+%
     " expression(s): One of the distribution parameters evaluated to a matrix of non-standard dimensions (its neither 1 nor n rows), make sure the distribution function knows how to handle it.")
     }
     }
     else {
     if (verbose)
     message("The node " %+% cur.node$name %+% " expression(s): " %+%
     expr_str %+% ".\n One of the formulas evaluated to unknown data type. Make sure the distribution function knowns how to handle it...")
     }
     distparam
    }
    <bytecode: 0x1e89d08>
    <environment: 0x38de528>
     --- function search by body ---
     ----------- END OF FAILURE REPORT --------------
    Quitting from lines 912-935 (simcausal_vignette.Rnw)
    Error: processing vignette 'simcausal_vignette.Rnw' failed with diagnostics:
    
    ...attempt to simulate data from DAG failed...
    --- failed re-building ‘simcausal_vignette.Rnw’
    
    SUMMARY: processing the following file failed:
     ‘simcausal_vignette.Rnw’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc