Running 'testthat.R'
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(SimBIID)
  > 
  > test_check("SimBIID")
  Warning message:
  In system(cmd) : 'make' not found
  
  
  WARNING: The tools required to build C++ code for R were not found.
  
  Please download and install the appropriate version of Rtools:
  
  http://cran.r-project.org/bin/windows/Rtools/
  
  Warning message:
  In system(cmd) : 'make' not found
  
  
  WARNING: The tools required to build C++ code for R were not found.
  
  Please download and install the appropriate version of Rtools:
  
  http://cran.r-project.org/bin/windows/Rtools/
  
  Warning message:
  In system(cmd) : 'make' not found
  
  
  WARNING: The tools required to build C++ code for R were not found.
  
  Please download and install the appropriate version of Rtools:
  
  http://cran.r-project.org/bin/windows/Rtools/
  
  Warning message:
  In system(cmd) : 'make' not found
  
  
  WARNING: The tools required to build C++ code for R were not found.
  
  Please download and install the appropriate version of Rtools:
  
  http://cran.r-project.org/bin/windows/Rtools/
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-ABCRef.R:15:5): ABCRef works ────────────────────────────────────
  Error in `sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, 
      showOutput = showOutput, verbose = verbose, echo = echo)`: Error 1 occurred building shared library.
  Backtrace:
      █
   1. ├─SimBIID::compileRcpp(model) test-ABCRef.R:15:4
   2. │ └─base::source(filename)
   3. │   ├─base::withVisible(eval(ei, envir))
   4. │   └─base::eval(ei, envir)
   5. │     └─base::eval(ei, envir)
   6. └─Rcpp::cppFunction("NumericVector simFunction(NumericVector pars, double tstart, double tstop, IntegerVector u) { \n\n    // initialise variables\n    double tstar = 0.0, u_tmp = 0.0, totrate = 0.0, cumrate = 0.0;\n    int i = 0;\n    \n    // initialise time and rates of the system\n    double t = tstart;\n    NumericVector rates(2);\n\n    // update rates\n    rates[0] = pars[0]*u[0]*u[1];\n    rates[1] = pars[1]*u[1];\n    totrate = sum(rates);\n    \n    // check states\n    for(i = 0; i < u.size(); i++){\n        if(u[i] < 0) {\n            stop(\"Some states less than zero\");\n        }\n    }\n    \n    // check rates\n    for(i = 0; i < rates.size(); i++){\n        if(R_FINITE(rates[i])) {\n            if(rates[i] < 0.0) {\n                stop(\"Some rates less than zero or non-finite\");\n            }\n        } else {\n            stop(\"Some rates are non-finite\");\n        }\n    }\n\n    // set up output vector\n    NumericVector out(u.size() + 2);\n    \n    // sample next event time\n    if(totrate > 0.0) {\n        tstar = t + R::rexp(1.0 / totrate);\n        while(tstar < tstop){\n            // update event type\n            u_tmp = R::runif(0.0, totrate);\n            cumrate = rates[0];\n            if(u_tmp < cumrate) {\n                u[0]--;\n                u[1]++;\n            } else {\n                u[1]--;\n                u[2]++;\n            }\n        \n            // update rates\n            rates[0] = pars[0]*u[0]*u[1];\n            rates[1] = pars[1]*u[1];\n            totrate = sum(rates);\n            \n            // check states\n            for(i = 0; i < u.size(); i++){\n                if(u[i] < 0) {\n                    stop(\"Some states less than zero\");\n                }\n            }\n            \n            // check rates\n            for(i = 0; i < rates.size(); i++){\n                if(R_FINITE(rates[i])) {\n                    if(rates[i] < 0.0) {\n                        stop(\"Some rates less than zero or non-finite\");\n                    }\n                } else {\n                    stop(\"Some rates are non-finite\");\n                }\n            }\n            \n            // update time\n            t = tstar;\n            \n            // sample next event time\n            if(totrate > 0.0) {\n                tstar = t + R::rexp(1.0 / totrate);\n            } else {\n                tstar = tstop;\n            }\n        }\n    }\n    \n    // record final event time\n    if(totrate > 0.0) {\n        t = tstop;\n    }\n    \n    // set output\n    out[0] = (totrate == 0.0 ? 1:0);\n    out[1] = t;\n    out[Range(2, u.size() + 1)] = as<NumericVector>(u);\n    \n    // return output\n    return out;\n}")
   7.   └─Rcpp::sourceCpp(...)
  ── Error (test-ABCSMC.R:15:5): ABCSMC works ────────────────────────────────────
  Error in `sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, 
      showOutput = showOutput, verbose = verbose, echo = echo)`: Error 1 occurred building shared library.
  Backtrace:
      █
   1. ├─SimBIID::compileRcpp(model) test-ABCSMC.R:15:4
   2. │ └─base::source(filename)
   3. │   ├─base::withVisible(eval(ei, envir))
   4. │   └─base::eval(ei, envir)
   5. │     └─base::eval(ei, envir)
   6. └─Rcpp::cppFunction("NumericVector simFunction(NumericVector pars, double tstart, double tstop, IntegerVector u) { \n\n    // initialise variables\n    double tstar = 0.0, u_tmp = 0.0, totrate = 0.0, cumrate = 0.0;\n    int i = 0;\n    \n    // initialise time and rates of the system\n    double t = tstart;\n    NumericVector rates(2);\n\n    // update rates\n    rates[0] = pars[0]*u[0]*u[1];\n    rates[1] = pars[1]*u[1];\n    totrate = sum(rates);\n    \n    // check states\n    for(i = 0; i < u.size(); i++){\n        if(u[i] < 0) {\n            stop(\"Some states less than zero\");\n        }\n    }\n    \n    // check rates\n    for(i = 0; i < rates.size(); i++){\n        if(R_FINITE(rates[i])) {\n            if(rates[i] < 0.0) {\n                stop(\"Some rates less than zero or non-finite\");\n            }\n        } else {\n            stop(\"Some rates are non-finite\");\n        }\n    }\n\n    // set up output vector\n    NumericVector out(u.size() + 2);\n    \n    // sample next event time\n    if(totrate > 0.0) {\n        tstar = t + R::rexp(1.0 / totrate);\n        while(tstar < tstop){\n            // update event type\n            u_tmp = R::runif(0.0, totrate);\n            cumrate = rates[0];\n            if(u_tmp < cumrate) {\n                u[0]--;\n                u[1]++;\n            } else {\n                u[1]--;\n                u[2]++;\n            }\n        \n            // update rates\n            rates[0] = pars[0]*u[0]*u[1];\n            rates[1] = pars[1]*u[1];\n            totrate = sum(rates);\n            \n            // check states\n            for(i = 0; i < u.size(); i++){\n                if(u[i] < 0) {\n                    stop(\"Some states less than zero\");\n                }\n            }\n            \n            // check rates\n            for(i = 0; i < rates.size(); i++){\n                if(R_FINITE(rates[i])) {\n                    if(rates[i] < 0.0) {\n                        stop(\"Some rates less than zero or non-finite\");\n                    }\n                } else {\n                    stop(\"Some rates are non-finite\");\n                }\n            }\n            \n            // update time\n            t = tstar;\n            \n            // sample next event time\n            if(totrate > 0.0) {\n                tstar = t + R::rexp(1.0 / totrate);\n            } else {\n                tstar = tstop;\n            }\n        }\n    }\n    \n    // record final event time\n    if(totrate > 0.0) {\n        t = tstop;\n    }\n    \n    // set output\n    out[0] = (totrate == 0.0 ? 1:0);\n    out[1] = t;\n    out[Range(2, u.size() + 1)] = as<NumericVector>(u);\n    \n    // return output\n    return out;\n}")
   7.   └─Rcpp::sourceCpp(...)
  ── Error (test-PMCMC.R:48:5): PMCMC works ──────────────────────────────────────
  Error in `sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, 
      showOutput = showOutput, verbose = verbose, echo = echo)`: Error 1 occurred building shared library.
  Backtrace:
       █
    1. ├─SimBIID::PMCMC(...) test-PMCMC.R:48:4
    2. ├─SimBIID:::PMCMC.default(...)
    3. │ └─SimBIID::compileRcpp(func)
    4. │   └─base::source(filename)
    5. │     ├─base::withVisible(eval(ei, envir))
    6. │     └─base::eval(ei, envir)
    7. │       └─base::eval(ei, envir)
    8. └─RcppXPtrUtils::cppXPtr("SEXP simFunction(NumericVector pars, double tstart, double tstop, IntegerVector u, IntegerVector counts) { \n\n    // initialise variables\n    double tstar = 0.0, u_tmp = 0.0, totrate = 0.0, cumrate = 0.0;\n    int i = 0;\n    \n    // initialise time and rates of the system\n    double t = tstart;\n    NumericVector rates(3);\n\n    // update rates\n    rates[0] = pars[0]*u[0]*u[1]/(u[0]+u[1]+u[2]+u[3]);\n    rates[1] = pars[1]*u[1];\n    rates[2] = pars[2]*u[2];\n    totrate = sum(rates);\n    \n    // check states\n    for(i = 0; i < u.size(); i++){\n        if(u[i] < 0) {\n            stop(\"Some states less than zero\");\n        }\n    }\n    \n    // check rates\n    for(i = 0; i < rates.size(); i++){\n        if(R_FINITE(rates[i])) {\n            if(rates[i] < 0.0) {\n                stop(\"Some rates less than zero or non-finite\");\n            }\n        } else {\n            stop(\"Some rates are non-finite\");\n        }\n    }\n\n    // set up output vector\n    NumericVector out(u.size() + 1);\n    \n    // sample next event time\n    if(totrate > 0.0) {\n        tstar = t + R::rexp(1.0 / totrate);\n        while(tstar < tstop){\n            // update event type\n            u_tmp = R::runif(0.0, totrate);\n            cumrate = rates[0];\n            if(u_tmp < cumrate) {\n                u[0]--;\n                u[1]++;\n            } else {\n                cumrate += rates[1];\n                if(u_tmp < cumrate) {\n                    u[1]--;\n                    u[2]++;\n                } else {\n                    u[2]--;\n                    u[3]++;\n                }\n            }\n        \n            // update rates\n            rates[0] = pars[0]*u[0]*u[1]/(u[0]+u[1]+u[2]+u[3]);\n            rates[1] = pars[1]*u[1];\n            rates[2] = pars[2]*u[2];\n            totrate = sum(rates);\n            \n            // check states\n            for(i = 0; i < u.size(); i++){\n                if(u[i] < 0) {\n                    stop(\"Some states less than zero\");\n                }\n            }\n            \n            // check rates\n            for(i = 0; i < rates.size(); i++){\n                if(R_FINITE(rates[i])) {\n                    if(rates[i] < 0.0) {\n                        stop(\"Some rates less than zero or non-finite\");\n                    }\n                } else {\n                    stop(\"Some rates are non-finite\");\n                }\n            }\n            \n            // update time\n            t = tstar;\n            \n            // sample next event time\n            if(totrate > 0.0) {\n                tstar = t + R::rexp(1.0 / totrate);\n            } else {\n                tstar = tstop;\n            }\n        }\n    }\n    \n    // record final event time\n    if(totrate > 0.0) {\n        t = tstop;\n    }\n    \n     out[0] = 0.0;\n     out[0] += R::dpois(counts[0], u[2]+1e-5, 1);\n     out[Range(1, u.size())] = as<NumericVector>(u);\n    \n    // return output\n    return out;\n}")
    9.   └─Rcpp::cppFunction(...)
   10.     └─Rcpp::sourceCpp(...)
  ── Failure (test-run.R:18:5): mparse/run works ─────────────────────────────────
  `compileRcpp(model)` threw an unexpected error.
  Message: Error 1 occurred building shared library.
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(compileRcpp(model), NA) test-run.R:18:4
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat:::.capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. ├─SimBIID::compileRcpp(model)
    8. │ └─base::source(filename)
    9. │   ├─base::withVisible(eval(ei, envir))
   10. │   └─base::eval(ei, envir)
   11. │     └─base::eval(ei, envir)
   12. └─Rcpp::cppFunction("NumericVector simFunction(NumericVector pars, double tstart, double tstop, IntegerVector u) { \n\n    // initialise variables\n    double tstar = 0.0, totrate = 0.0;\n    int i = 0;\n    \n    // initialise time and rates of the system\n    double t = tstart;\n    NumericVector rates(1);\n\n    // update rates\n    rates[0] = pars[0]*u[0]*u[1];\n    totrate = sum(rates);\n    \n    // check states\n    for(i = 0; i < u.size(); i++){\n        if(u[i] < 0) {\n            stop(\"Some states less than zero\");\n        }\n    }\n    \n    // check rates\n    for(i = 0; i < rates.size(); i++){\n        if(R_FINITE(rates[i])) {\n            if(rates[i] < 0.0) {\n                stop(\"Some rates less than zero or non-finite\");\n            }\n        } else {\n            stop(\"Some rates are non-finite\");\n        }\n    }\n\n    // set up output vector\n    NumericVector out(u.size() + 2);\n    \n    // sample next event time\n    if(totrate > 0.0) {\n        tstar = t + R::rexp(1.0 / totrate);\n        while(tstar < tstop){\n            // update event type\n            u[0]--;\n            u[1]++;\n        \n            // update rates\n            rates[0] = pars[0]*u[0]*u[1];\n            totrate = sum(rates);\n            \n            // check states\n            for(i = 0; i < u.size(); i++){\n                if(u[i] < 0) {\n                    stop(\"Some states less than zero\");\n                }\n            }\n            \n            // check rates\n            for(i = 0; i < rates.size(); i++){\n                if(R_FINITE(rates[i])) {\n                    if(rates[i] < 0.0) {\n                        stop(\"Some rates less than zero or non-finite\");\n                    }\n                } else {\n                    stop(\"Some rates are non-finite\");\n                }\n            }\n            \n            // update time\n            t = tstar;\n            \n            // sample next event time\n            if(totrate > 0.0) {\n                tstar = t + R::rexp(1.0 / totrate);\n            } else {\n                tstar = tstop;\n            }\n        }\n    }\n    \n    // record final event time\n    if(totrate > 0.0) {\n        t = tstop;\n    }\n    \n    // set output\n    out[0] = (totrate == 0.0 ? 1:0);\n    out[1] = t;\n    out[Range(2, u.size() + 1)] = as<NumericVector>(u);\n    \n    // return output\n    return out;\n}")
   13.   └─Rcpp::sourceCpp(...)
  
  [ FAIL 4 | WARN 0 | SKIP 1 | PASS 0 ]
  Error: Test failures
  Execution halted