Running 'testthat.R' [8s/9s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > if (require("testthat")) {
  +   test_check("coala")
  + } else {
  +   warning("testthat not available. Skipping unittests!")
  + }
  Loading required package: testthat
  Loading required package: coala
  -- 1. Error: generation of rehh data works (@test-sumstat-iHH.R#31)  -----------
  'position' is not a slot in class "haplohh"
  1: stat_ihh$create_rehh_data(seg_sites, 1:4, model) at testthat/test-sumstat-iHH.R:31
  2: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  3: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  -- 2. Error: SNPs not segregating in individuals are removed from rehh_data (@te
  'position' is not a slot in class "haplohh"
  1: stat_ihh$create_rehh_data(seg_sites, 1:2, model) at testthat/test-sumstat-iHH.R:49
  2: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  3: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  -- 3. Error: selection of snps works (@test-sumstat-iHH.R#60)  -----------------
  'position' is not a slot in class "haplohh"
  1: stat_ihh$create_rehh_data(seg_sites, 1:4, model) at testthat/test-sumstat-iHH.R:60
  2: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  3: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  -- 4. Error: calculation of ihh works (@test-sumstat-iHH.R#81)  ----------------
  'position' is not a slot in class "haplohh"
  1: stat_ihh$calculate(list(seg_sites), NULL, NULL, model) at testthat/test-sumstat-iHH.R:81
  2: do.call(rbind, lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     }))
  3: lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     })
  4: FUN(X[[i]], ...)
  5: self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
  6: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  7: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  -- 5. Error: ihh can be calculated for all populations (@test-sumstat-iHH.R#99) 
  'position' is not a slot in class "haplohh"
  1: expect_equal(stat_ihh$calculate(list(seg_sites), NULL, NULL, coal_model(c(2, 2), 
         1, 337)), stat_ihh$calculate(list(seg_sites), NULL, NULL, coal_model(4, 1, 337))) at testthat/test-sumstat-iHH.R:99
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: stat_ihh$calculate(list(seg_sites), NULL, NULL, coal_model(c(2, 2), 1, 337))
  5: do.call(rbind, lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     }))
  6: lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     })
  7: FUN(X[[i]], ...)
  8: self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
  9: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  10: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  -- 6. Error: calculation of ihs works (@test-sumstat-iHH.R#110)  ---------------
  'position' is not a slot in class "haplohh"
  1: stat_ihh$calculate(list(seg_sites), NULL, NULL, model) at testthat/test-sumstat-iHH.R:110
  2: do.call(rbind, lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     }))
  3: lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     })
  4: FUN(X[[i]], ...)
  5: self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
  6: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  7: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  -- 7. Error: calculation of iHS works with few SNPS (@test-sumstat-iHH.R#136)  -
  'position' is not a slot in class "haplohh"
  1: stat_ihh$calculate(list(seg_sites2), NULL, NULL, model2) at testthat/test-sumstat-iHH.R:136
  2: do.call(rbind, lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     }))
  3: lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     })
  4: FUN(X[[i]], ...)
  5: self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
  6: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  7: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  -- 8. Error: ihh works with trios (@test-sumstat-iHH.R#150)  -------------------
  'position' is not a slot in class "haplohh"
  1: ihh$calculate(stats$seg_sites, NULL, NULL, model) at testthat/test-sumstat-iHH.R:150
  2: do.call(rbind, lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     }))
  3: lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     })
  4: FUN(X[[i]], ...)
  5: self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
  6: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  7: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  -- 9. Error: ihh works with empty segsites (@test-sumstat-iHH.R#161)  ----------
  'position' is not a slot in class "haplohh"
  1: ihh$calculate(seg_sites, NULL, NULL, coal_model(4, 2, 337)) at testthat/test-sumstat-iHH.R:161
  2: do.call(rbind, lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     }))
  3: lapply(seq_along(seg_sites), function(locus) {
         assert_that(is_segsites(seg_sites[[locus]]))
         if (ncol(seg_sites[[locus]]) == 0) 
             return(private$empty_matrix)
         rehh_data <- self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
         if (rehh_data@nsnp == 0) 
             return(private$empty_matrix)
         data.frame(rehh::scan_hh(rehh_data))
     })
  4: FUN(X[[i]], ...)
  5: self$create_rehh_data(seg_sites[[locus]], ind, model, locus)
  6: (function (cl, name, valueClass) 
     {
         ClassDef <- getClass(cl)
         slotClass <- ClassDef@slots[[name]]
         if (is.null(slotClass)) 
             stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), 
                 domain = NA)
         if (.identC(slotClass, valueClass)) 
             return(TRUE)
         ok <- possibleExtends(valueClass, slotClass, ClassDef2 = getClassDef(slotClass, 
             where = .classEnv(ClassDef)))
         if (isFALSE(ok)) 
             stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", 
                 dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
         TRUE
     })(structure("haplohh", package = "rehh"), "position", "numeric")
  7: stop(gettextf("%s is not a slot in class %s", sQuote(name), dQuote(cl)), domain = NA)
  
  == testthat results  ===========================================================
  OK: 821 SKIPPED: 41 WARNINGS: 0 FAILED: 9
  1. Error: generation of rehh data works (@test-sumstat-iHH.R#31) 
  2. Error: SNPs not segregating in individuals are removed from rehh_data (@test-sumstat-iHH.R#49) 
  3. Error: selection of snps works (@test-sumstat-iHH.R#60) 
  4. Error: calculation of ihh works (@test-sumstat-iHH.R#81) 
  5. Error: ihh can be calculated for all populations (@test-sumstat-iHH.R#99) 
  6. Error: calculation of ihs works (@test-sumstat-iHH.R#110) 
  7. Error: calculation of iHS works with few SNPS (@test-sumstat-iHH.R#136) 
  8. Error: ihh works with trios (@test-sumstat-iHH.R#150) 
  9. Error: ihh works with empty segsites (@test-sumstat-iHH.R#161) 
  
  Error: testthat unit tests failed
  Execution halted