Running ‘test-all.R’ [142s/156s]
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: 0x3996510>
  <environment: 0x38c5200>
   --- function search by body ---
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(distparam) %in% "list") { : 
    the condition has length > 1
  Timing stopped at: 1.783 0.184 2.199
  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: 0x3996510>
  <environment: 0xd3b5e60>
   --- function search by body ---
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(distparam) %in% "list") { : 
    the condition has length > 1
  Timing stopped at: 0.319 0.004 0.341
  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: 0x3996510>
  <environment: 0x6c82318>
   --- 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 0.03
  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: 0x3996510>
  <environment: 0xf938b90>
   --- 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(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: 0x3996510>
  <environment: 0x11a22650>
   --- 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(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.540   0.018   0.567 
  simulating observed dataset from the DAG object
     user  system elapsed 
    0.568   0.005   0.693 
  simulating observed dataset from the DAG object
     user  system elapsed 
    0.607   0.000   0.682 
  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: 0x3996510>
  <environment: 0x12b59ef0>
   --- function search by body ---
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(distparam) %in% "list") { : 
    the condition has length > 1
  Timing stopped at: 0.024 0 0.024
  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,]    5   10
  [3,]   NA   NA
  [4,]   NA   NA
  [5,]   NA   NA
  [6,]   NA   NA
  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,]    8   NA
  [3,]   NA   NA
  [4,]   NA   NA
  [5,]    2    3
  [6,]   10   NA
  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    9
  [3,]    5    8
  [4,]    1   NA
  [5,]    6    9
  [6,]   NA   NA
  simulating network with ER model using m: 10
  [1] "automatic Kmax: "
  [1] 2
  [1] "NetInd_k"
       [,1] [,2]
  [1,]    4   NA
  [2,]    3    6
  [3,]   NA   NA
  [4,]    1   NA
  [5,]   10   NA
  [6,]   10   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: 0x3996510>
  <environment: 0x77ab7c0>
   --- function search by body ---
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(distparam) %in% "list") { : 
    the condition has length > 1
  Timing stopped at: 1.933 0.029 2.175
  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: 0x3996510>
  <environment: 0xc4eb658>
   --- function search by body ---
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(distparam) %in% "list") { : 
    the condition has length > 1
  Timing stopped at: 0.032 0.003 0.036
  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: 0x3996510>
  <environment: 0x1de0a810>
   --- function search by body ---
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(distparam) %in% "list") { : 
    the condition has length > 1
  Timing stopped at: 1.202 0.1 1.414
  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  2 01:35:49 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