Running ‘testthat.R’ [17s/24s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(o2geosocial)
  Registered S3 methods overwritten by 'o2geosocial':
    method                    from       
    plot.outbreaker_chains    outbreaker2
    print.custom_likelihoods  outbreaker2
    print.custom_priors       outbreaker2
    print.outbreaker_chains   outbreaker2
    summary.outbreaker_chains outbreaker2
  > 
  > test_check("o2geosocial")
  
  
   ///// outbreaker custom likelihoods ///
  
  class: custom_likelihoods list
  number of items: 5 
  
  /// custom likelihoods set to NULL (default used) //
  $reporting
  NULL
  
  $timing_infections
  NULL
  
  $timing_sampling
  NULL
  
  $space
  NULL
  
  $age
  NULL
  
  
  
   ///// outbreaker custom likelihoods ///
  
  class: custom_likelihoods list
  number of items: 5 
  
  /// custom likelihoods //
  $reporting
  function(data, param, i) cpp_ll_reporting(data, param, i)
  <environment: 0x58a5808>
  
  $timing_infections
  function(data, param, i) cpp_ll_timing_infections(data, param, i)
  <environment: 0x58a5808>
  
  $timing_sampling
  function(data, param, i) cpp_ll_timing_sampling(data, param, i)
  <environment: 0x58a5808>
  
  $space
  function(data, config, param, i) cpp_ll_space(data, config, param, i)
  <environment: 0x58a5808>
  
  $age
  function(data, param, i) cpp_ll_age(data, param, i)
  <environment: 0x58a5808>
  
  
  
   ///// outbreaker results ///
  
  class:  outbreaker_chains data.frame
  dimensions 21 rows,  22 columns
  ancestries not shown: alpha_2 - alpha_5
  infection dates not shown: t_inf_1 - t_inf_5
  intermediate generations not shown: kappa_1 - kappa_5
  
  /// head //
    step      post      like      prior   a   b        pi alpha_1
  1    1 -32.88389 -33.28774  0.4038415 0.7 0.1 0.9103669      NA
  2   50 -39.51264 -38.91464 -0.5980045 0.7 0.1 0.8051902       2
  3  100 -34.21771 -35.52312  1.3054073 0.7 0.1 0.9948269       2
  
  ...
  /// tail //
     step      post      like     prior   a   b        pi alpha_1
  19  900 -32.02185 -33.24110 1.2192534 0.7 0.1 0.9853492       5
  20  950 -33.65435 -34.66317 1.0088272 0.7 0.1 0.9625783       2
  21 1000 -35.73840 -36.49890 0.7604945 0.7 0.1 0.9363814       2
  
  
   ///// outbreaker results ///
  
  class:  outbreaker_chains data.frame
  dimensions 21 rows,  22 columns
  ancestries not shown: alpha_2 - alpha_5
  infection dates not shown: t_inf_1 - t_inf_5
  intermediate generations not shown: kappa_1 - kappa_5
  
  /// head //
    step      post      like      prior   a   b        pi alpha_1
  1    1 -32.88389 -33.28774  0.4038415 0.7 0.1 0.9103669      NA
  2   50 -39.51264 -38.91464 -0.5980045 0.7 0.1 0.8051902       2
  
  ...
  /// tail //
     step      post      like     prior   a   b        pi alpha_1
  20  950 -33.65435 -34.66317 1.0088272 0.7 0.1 0.9625783       2
  21 1000 -35.73840 -36.49890 0.7604945 0.7 0.1 0.9363814       2
  
  
   ///// outbreaker results ///
  
  class:  outbreaker_chains data.frame
  dimensions 21 rows,  22 columns
  ancestries not shown: alpha_1 - alpha_5
  infection dates not shown: t_inf_1 - t_inf_5
  intermediate generations not shown: kappa_1 - kappa_5
  
  /// head //
    step      post      like      prior
  1    1 -32.88389 -33.28774  0.4038415
  2   50 -39.51264 -38.91464 -0.5980045
  3  100 -34.21771 -35.52312  1.3054073
  
  ...
  /// tail //
     step      post      like     prior
  19  900 -32.02185 -33.24110 1.2192534
  20  950 -33.65435 -34.66317 1.0088272
  21 1000 -35.73840 -36.49890 0.7604945
  
  
  /// head //
    1 2 3 4 5
  1 0 0 0 0 1
  2 0 0 0 0 1
  3 0 0 0 0 1
  
  ...
  /// tail //
     1 2 3 4 5
  19 0 0 0 0 1
  20 0 0 0 0 1
  21 0 0 0 0 1
  
   Biggest cluster: 5
   Cluster not shown: 2 to 5 
  
  
  /// head //
    1 2
  1 0 0
  2 0 0
  3 0 0
  
  ...
  /// tail //
     1 2
  19 0 0
  20 0 0
  21 0 0
  
  
  /// head //
    1 2 3 4 5
  1 0 0 0 0 1
  2 0 0 0 0 1
  3 0 0 0 0 1
  
  ...
  /// tail //
     1 2 3 4 5
  19 0 0 0 0 1
  20 0 0 0 0 1
  21 0 0 0 0 1
  
   *** caught segfault ***
  address 0x1, cause 'memory not mapped'
  
  Traceback:
   1: .Call(`_o2geosocial_cpp_move_alpha`, param, data, config, list_custom_ll)
   2: moves[[j]](param_current)
   3: outbreaker_move(moves = moves, data = data, param_current = param_current,     param_store = param_store, config = config, likelihoods = loglike,     priors = priors)
   4: outbreaker(data, config)
   5: eval(code, test_env)
   6: eval(code, test_env)
   7: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
   8: doTryCatch(return(expr), name, parentenv, handler)
   9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  11: doTryCatch(return(expr), name, parentenv, handler)
  12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  13: tryCatchList(expr, classes, parentenv, handlers)
  14: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  15: test_code(desc, code, env = parent.frame(), default_reporter = local_interactive_reporter())
  16: test_that("Results work, all component", {    alpha <- c(NA, rep(1, 4))    times <- c(0, 4, 8, 9, 23)    f <- c(0.1, 0.2, 0.4, 0.2, 0.05, 0.03, 0.01, 0.005, 0.005)    w <- c(0.05, 0.1, 0.25, 0.5, 0.05, 0.03, 0.01, 0.005, 0.005)    data(toy_outbreak_short)    age_dens <- toy_outbreak_short$age_contact    age <- c(1, 3, 3, 5, 1)    regions <- c(1, 1, 2, 2, 3)    population <- c(10000, 50000, 5000)    distance <- matrix(c(0, 15, 10, 15, 0, 60, 10, 60, 0), ncol = 3)    names(population) <- colnames(distance) <- rownames(distance) <- 1:3    genotype <- c("Not attributed", "B4", "Not attributed", "Not attributed",         "B4")    data <- outbreaker_data(dates = times, region = regions,         population = population, distance = distance, age_group = age,         a_dens = age_dens, w_dens = w, f_dens = f, genotype = genotype)    config <- create_config(data = data, init_tree = alpha, n_iter = 1000,         n_iter_import = 500, burnin = 200)    out <- outbreaker(data, config)    out_summary <- summary(out, burnin = config$burnin)    expect_true(all(out_summary$post > -50))    expect_true(out_summary$tree[out_summary$tree$to == 2, "support"] >         0.9)    expect_true(out_summary$tree[out_summary$tree$to == 2, "from"] ==         1)    expect_true(out_summary$tree[out_summary$tree$to == 5, "generations"] ==         2)})
  17: eval(code, test_env)
  18: eval(code, test_env)
  19: withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error)
  20: doTryCatch(return(expr), name, parentenv, handler)
  21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  23: doTryCatch(return(expr), name, parentenv, handler)
  24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  25: tryCatchList(expr, classes, parentenv, handlers)
  26: tryCatch(withCallingHandlers({    eval(code, test_env)    if (!handled && !is.null(test)) {        skip_empty()    }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning,     message = handle_message, error = handle_error), error = handle_fatal,     skip = function(e) {    })
  27: test_code(test = NULL, code = exprs, env = env, default_reporter = StopReporter$new())
  28: source_file(path, env = env(env), desc = desc, error_call = error_call)
  29: FUN(X[[i]], ...)
  30: lapply(test_paths, test_one_file, env = env, desc = desc, error_call = error_call)
  31: doTryCatch(return(expr), name, parentenv, handler)
  32: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  33: tryCatchList(expr, classes, parentenv, handlers)
  34: tryCatch(code, testthat_abort_reporter = function(cnd) {    cat(conditionMessage(cnd), "\n")    NULL})
  35: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, desc = desc, error_call = error_call))
  36: test_files_serial(test_dir = test_dir, test_package = test_package,     test_paths = test_paths, load_helpers = load_helpers, reporter = reporter,     env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     desc = desc, load_package = load_package, error_call = error_call)
  37: test_files(test_dir = path, test_paths = test_paths, test_package = package,     reporter = reporter, load_helpers = load_helpers, env = env,     stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     load_package = load_package, parallel = parallel)
  38: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  39: test_check("o2geosocial")
  An irrecoverable exception occurred. R is aborting now ...