Running ‘testthat.R’ [18s/25s]
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) cpp_ll_reporting(data, param)
  <environment: 0x55c4bd14f318>
  
  $timing_infections
  function(data, param) cpp_ll_timing_infections(data, param)
  <environment: 0x55c4bd14f318>
  
  $timing_sampling
  function(data, param) cpp_ll_timing_sampling(data, param)
  <environment: 0x55c4bd14f318>
  
  $space
  function(data, param) cpp_ll_space(data, config, param)
  <environment: 0x55c4bd14f318>
  
  $age
  function(data, param) cpp_ll_age(data, param)
  <environment: 0x55c4bd14f318>
  
  
  
   ///// 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 -51.01607 -51.41991 0.4038415 0.7 0.1 0.9486237      NA
  2   50 -34.86155 -36.18298 1.3214249 0.7 0.1 0.9965990      NA
  3  100 -35.67571 -36.71420 1.0384827 0.7 0.1 0.9657553      NA
  
  ...
  /// tail //
     step      post      like      prior   a   b        pi alpha_1
  19  900 -37.67874 -37.94831  0.2695693 0.7 0.1 0.8866724       2
  20  950 -33.04193 -34.17250  1.1305640 0.7 0.1 0.9756869       2
  21 1000 -39.07732 -38.94100 -0.1363213 0.7 0.1 0.8475727       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 -51.01607 -51.41991 0.4038415 0.7 0.1 0.9486237      NA
  2   50 -34.86155 -36.18298 1.3214249 0.7 0.1 0.9965990      NA
  
  ...
  /// tail //
     step      post     like      prior   a   b        pi alpha_1
  20  950 -33.04193 -34.1725  1.1305640 0.7 0.1 0.9756869       2
  21 1000 -39.07732 -38.9410 -0.1363213 0.7 0.1 0.8475727       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 -51.01607 -51.41991 0.4038415
  2   50 -34.86155 -36.18298 1.3214249
  3  100 -35.67571 -36.71420 1.0384827
  
  ...
  /// tail //
     step      post      like      prior
  19  900 -37.67874 -37.94831  0.2695693
  20  950 -33.04193 -34.17250  1.1305640
  21 1000 -39.07732 -38.94100 -0.1363213
  
  
  /// 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
  
  
   ///// outbreaker custom priors ///
  
  class: custom_priors list
  number of items: 3 
  
  /// custom priors set to NULL (default used) //
  $pi
  NULL
  
  $a
  NULL
  
  $b
  NULL
  
  
  
   ///// outbreaker custom priors ///
  
  class: custom_priors list
  number of items: 3 
  
  /// custom priors //
  $pi
  function(param){
      return(dnorm(x = param$pi, mean = config$prior_pi[1], sd = config$prior_pi[2], log = T))
    }
  <environment: 0x55c4c14d6588>
  
  $a
  function(param){
      return(dnorm(x = param$a, mean = config$prior_a[1], sd = config$prior_a[2], log = T))
    }
  <environment: 0x55c4c14d6588>
  
  $b
  function(param){
      return(dnorm(x = param$b, mean = config$prior_b[1], sd = config$prior_b[2], log = T))
    }
  <environment: 0x55c4c14d6588>
  
  ══ Warnings ════════════════════════════════════════════════════════════════════
  ── Warning (test_config.R:25:3): test: settings are processed fine ─────────────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker_data(...) test_config.R:25:2
  ── Warning (test_config.R:113:3): test: initial tree does not mix genotypes ────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker_data(...) test_config.R:113:2
  ── Warning (test_likelihood.R:10:3): test timing_infections:  ──────────────────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::create_config(data = data, init_tree = alpha) test_likelihood.R:10:2
  ── Warning (test_likelihood.R:33:3): test timing_sampling:  ────────────────────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::create_config(data = data, init_t_inf = times, init_tree = alpha) test_likelihood.R:33:2
  ── Warning (test_likelihood.R:60:3): test age:  ────────────────────────────────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::create_config(data = data, init_tree = alpha) test_likelihood.R:60:2
  ── Warning (test_likelihood.R:86:3): test reporting:  ──────────────────────────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::create_config(data = data, init_tree = alpha, init_kappa = kappa) test_likelihood.R:86:2
  ── Warning (test_likelihood.R:354:3): Function return -inf if incorrect parameters ──
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::create_config(data = data, init_tree = alpha) test_likelihood.R:354:2
  ── Warning (test_moves.R:23:3): test: try different default movements ──────────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker_data(...) test_moves.R:23:2
  ── Warning (test_moves.R:34:3): test: try different default movements ──────────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker_data(data = pre_clust[["data"]]) test_moves.R:34:2
  ── Warning (test_moves.R:84:3): test: try different default movements ──────────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker_data(...) test_moves.R:84:2
  ── Warning (test_moves.R:133:3): test: try customization movements ─────────────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker_data(...) test_moves.R:133:2
  ── Warning (test_moves.R:141:3): test: try customization movements ─────────────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker_data(data = pre_clust[["data"]]) test_moves.R:141:2
  ── Warning (test_moves.R:157:3): test: try customization movements ─────────────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker(data, config, moves = list(pi = move_null)) test_moves.R:157:2
   2. o2geosocial::outbreaker_data(data = data)
  ── Warning (test_moves.R:157:3): test: try customization movements ─────────────
  Removed trailing zeroes found in w_dens
  Backtrace:
   1. o2geosocial::outbreaker(data, config, moves = list(pi = move_null)) test_moves.R:157:2
   2. o2geosocial::outbreaker_data(data = pre_clust[["data"]])
  ── Warning (test_outbreaker.R:140:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::create_config(...) test_outbreaker.R:140:2
  ── Warning (test_outbreaker.R:143:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:143:2
   2. o2geosocial::create_config(config, data = data)
  ── Warning (test_outbreaker.R:143:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:143:2
   2. o2geosocial::pre_clustering(data = data, config = config)
   3. o2geosocial::create_config(config, data = data)
  ── Warning (test_outbreaker.R:143:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:143:2
   2. o2geosocial::create_config(config = pre_clust[["config"]], data = data)
  ── Warning (test_outbreaker.R:156:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::create_config(...) test_outbreaker.R:156:2
  ── Warning (test_outbreaker.R:161:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:161:2
   2. o2geosocial::create_config(config, data = data)
  ── Warning (test_outbreaker.R:161:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:161:2
   2. o2geosocial::pre_clustering(data = data, config = config)
   3. o2geosocial::create_config(config, data = data)
  ── Warning (test_outbreaker.R:161:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:161:2
   2. o2geosocial::create_config(config = pre_clust[["config"]], data = data)
  ── Warning (test_outbreaker.R:165:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::create_config(...) test_outbreaker.R:165:2
  ── Warning (test_outbreaker.R:168:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:168:2
   2. o2geosocial::create_config(config, data = data)
  ── Warning (test_outbreaker.R:168:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:168:2
   2. o2geosocial::pre_clustering(data = data, config = config)
   3. o2geosocial::create_config(config, data = data)
  ── Warning (test_outbreaker.R:168:3): Results work, 1 component at the time ────
  move_a and move_b are set to FALSE since data$population, data$region or data$distance is null
  Backtrace:
   1. o2geosocial::outbreaker(...) test_outbreaker.R:168:2
   2. o2geosocial::create_config(config = pre_clust[["config"]], data = data)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test_preclust.R:39:3): test: pre clustering gives expected output ────
  Error: subscript out of bounds
  Backtrace:
      █
   1. └─o2geosocial::pre_clustering(data = data, config = config) test_preclust.R:39:2
  
  [ FAIL 1 | WARN 26 | SKIP 0 | PASS 196 ]
  Error: Test failures
  Execution halted