Running ‘testthat.R’ [52s/123s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(mosaic)
  Loading required package: dplyr
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  Loading required package: lattice
  Loading required package: ggformula
  Loading required package: ggplot2
  Loading required package: ggstance
  
  Attaching package: 'ggstance'
  
  The following objects are masked from 'package:ggplot2':
  
      GeomErrorbarh, geom_errorbarh
  
  
  New to ggformula?  Try the tutorials: 
  	learnr::run_tutorial("introduction", package = "ggformula")
  	learnr::run_tutorial("refining", package = "ggformula")
  Loading required package: mosaicData
  Loading required package: Matrix
  Registered S3 method overwritten by 'mosaic':
    method                           from   
    fortify.SpatialPolygonsDataFrame ggplot2
  
  The 'mosaic' package masks several functions from core packages in order to add 
  additional features.  The original behavior of these functions should not be affected by this.
  
  Note: If you use the Matrix package, be sure to load it BEFORE loading mosaic.
  
  Have you tried the ggformula package for your plots?
  
  Attaching package: 'mosaic'
  
  The following object is masked from 'package:Matrix':
  
      mean
  
  The following object is masked from 'package:ggplot2':
  
      stat
  
  The following objects are masked from 'package:dplyr':
  
      count, do, tally
  
  The following objects are masked from 'package:stats':
  
      IQR, binom.test, cor, cor.test, cov, fivenum, median, prop.test,
      quantile, sd, t.test, var
  
  The following objects are masked from 'package:base':
  
      max, mean, min, prod, range, sample, sum
  
  > 
  > test_check("mosaic")
  ── 1. Error: formula interface works  ──────────────────────────────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
   1. mosaic::mean_(x = ~cesd, data = mosaicData::HELPrct)
   2. mosaic::maggregate(...)
   3. mosaicCore::evalFormula(formula, data = data)
   4. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
   5. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   7. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 2. Error: formulas work without data (@test-aggregating.R#30)  ──────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
    1. testthat::expect_equivalent(min(age), min(~age))
    4. mosaic::min(~age)
    5. mosaic::maggregate(...)
    6. mosaicCore::evalFormula(formula, data = data)
    7. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
    8. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   10. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 3. Error: var() works. (@test-aggregating.R#80)  ────────────────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
    1. testthat::expect_equivalent(...)
    4. mosaic::var(age ~ sex, data = HELPrct)
    5. mosaic::maggregate(...)
    6. mosaicCore::evalFormula(formula, data = data)
    7. mosaicCore::evalSubFormula(...)
    8. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   10. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 4. Error: aggregatingFunctions work (@test-aggregating.R#101)  ──────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
    1. testthat::expect_equivalent(24.7230769230769, foo(~length, data = KidsFeet))
    4. mosaic:::foo(~length, data = KidsFeet)
    5. mosaic::maggregate(...)
    6. mosaicCore::evalFormula(formula, data = data)
    7. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
    8. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   10. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 5. Error: aggregating functions are compatible with dplyr (@test-aggregating.
  Problem with `summarise()` input `mean`.
  ✖ cannot coerce class '"function"' to a data.frame
  ℹ Input `mean` is `mean(~x)`.
  Backtrace:
    1. testthat::expect_equivalent(...)
   28. base::.handleSimpleError(...)
   29. dplyr:::h(simpleError(msg, call))
  
  ── 6. Error: bargraph works (@test-bargraph.R#8)  ──────────────────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
    1. vdiffr::expect_doppelganger(...)
    4. mosaic::bargraph(~substance, data = HELPrct)
    6. mosaicCore:::tally.formula(...)
    7. mosaicCore::evalFormula(formula, data)
    8. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
    9. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   11. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 7. Error: Confidence Intervals created (@test-confint.R#131)  ───────────────
  Invalid formula specification.  Too many slots (4>3).
  Backtrace:
    1. testthat::expect_equal(confint(bootstrap), result1)
    5. mosaic:::confint.do.data.frame(bootstrap)
    7. mosaic:::extract_estimate(object)
    8. [ base::eval(...) ] with 1 more call
   10. mosaic::diffmean(age ~ sex, data = resample(HELPrct))
   11. mosaic::mean_(x, ..., data = data)
   12. mosaic::maggregate(...)
   13. mosaicCore::mosaic_formula_q(formula, groups = groups, envir = .envir)
  
  ── 8. Error: naming as expected  ───────────────────────────────────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
   1. mosaic::mean_(x = ~cesd, data = mosaicData::HELPrct)
   2. mosaic::maggregate(...)
   3. mosaicCore::evalFormula(formula, data = data)
   4. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
   5. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   7. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 9. Error: dimension as expected  ────────────────────────────────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
   1. mosaic::mean_(x = ~cesd, data = mosaicData::HELPrct)
   2. mosaic::maggregate(...)
   3. mosaicCore::evalFormula(formula, data = data)
   4. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
   5. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   7. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 10. Error: with() works in place of data =   ────────────────────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
   1. mosaic::mean_(x = ~length, data = mosaicData::KidsFeet)
   2. mosaic::maggregate(...)
   3. mosaicCore::evalFormula(formula, data = data)
   4. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
   5. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   7. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 11. Error: formula interface works (@test-favstats.R#18)  ───────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
    1. testthat::expect_equivalent(...)
    4. mosaic::favstats(~age, data = mosaicData::HELPrct)
    5. mosaic::maggregate(...)
    6. mosaicCore::evalFormula(formula, data = data)
    7. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
    8. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   10. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 12. Error: formulas work without data (@test-favstats.R#22)  ────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
    1. testthat::expect_equivalent(favstats(1:10), favstats(~1:10))
    4. mosaic::favstats(~1:10)
    5. mosaic::maggregate(...)
    6. mosaicCore::evalFormula(formula, data = data)
    7. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
    8. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   10. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 13. Error: plotDist works  ──────────────────────────────────────────────────
  Invalid formula specification.  Too many slots (4>3).
  Backtrace:
   1. mosaic::mean_(x = ~age | sex, data = HELPrct)
   2. mosaic::maggregate(...)
   3. mosaicCore::mosaic_formula_q(formula, groups = groups, envir = .envir)
  
  ── 14. Error: plotModel works (@test-plotModel.R#13)  ──────────────────────────
  Invalid formula specification.  Too many slots (4>3).
  Backtrace:
    1. vdiffr::expect_doppelganger("plotModel3", plotModel(mod3))
    5. mosaic:::plotModel.default(mod3)
    7. mosaic:::plotModel.parsedModel(parseModel(mod), ...)
    9. base::lapply(other_data, some_levels)
   10. mosaic:::FUN(X[[i]], ...)
   13. mosaic::ntiles(x, 3, format = "median")
   14. mosaic::min(x ~ bin, na.rm = TRUE)
   15. mosaic::maggregate(...)
   16. mosaicCore::mosaic_formula_q(formula, groups = groups, envir = .envir)
  
  ── 15. Error: formula interface works. (@test-pqrdata.R#6)  ────────────────────
  cannot coerce class '"function"' to a data.frame
  Backtrace:
    1. testthat::expect_equivalent(...)
    4. mosaic::rdata(~age, 10, data = mosaicData::HELPrct)
    6. mosaic::rdata_f(...)
    7. mosaic::maggregate(...)
    8. mosaicCore::evalFormula(formula, data = data)
    9. mosaicCore::evalSubFormula(rhs(formula), ops = ops, data, env = environment(formula))
   10. base::data.frame(eval(x, data, env), stringsAsFactors = FALSE)
   12. base::as.data.frame.default(x[[i]], optional = TRUE)
  
  ── 16. Error: formulas work (@test-proptest.R#14)  ─────────────────────────────
  object of type 'closure' is not subsettable
  Backtrace:
   1. mosaic::prop.test(~a, data = TestData)
   3. mosaic:::prop_test.formula(...)
   4. lattice::latticeParseFormula(...)
  
  ── 17. Error: success = works (@test-proptest.R#54)  ───────────────────────────
  object of type 'closure' is not subsettable
  Backtrace:
   1. mosaic::prop.test(~a, data = TestData, success = "b")
   3. mosaic:::prop_test.formula(...)
   4. lattice::latticeParseFormula(...)
  
  ── 18. Error: (unknown) (@test-statTally.R#35)  ────────────────────────────────
  Invalid formula specification.  Too many slots (4>3).
  Backtrace:
   1. mosaic::diffmean(age ~ sex, data = HELPrct)
   2. mosaic::mean_(x, ..., data = data)
   3. mosaic::maggregate(...)
   4. mosaicCore::mosaic_formula_q(formula, groups = groups, envir = .envir)
  
  ── 19. Error: 2-sample tests give same results as stats::t.test (@test-ttest.R#1
  Invalid formula specification.  Too many slots (3>2).
  Backtrace:
   1. testthat::expect_equivalent(...)
   6. mosaic:::t_test.formula(y ~ a)
   7. mosaicCore::mosaic_formula_q(...)
  
  ── 20. Error: paired tests give same results as stats::t.test (@test-ttest.R#53)
  invalid type (closure) for variable 'groups'
  Backtrace:
    1. testthat::expect_equivalent(...)
    6. mosaic:::t_test.formula(~(father - height), data = Boys)
   12. stats::model.frame.default(formula = formula, data = data)
  
  ── 21. Error: 1-sample tests give same results as stats::t.test (@test-ttest.R#6
  invalid type (closure) for variable 'groups'
  Backtrace:
    1. testthat::expect_equivalent(...)
    6. mosaic:::t_test.formula(~height, data = Boys)
   12. stats::model.frame.default(formula = formula, data = data)
  
  [1] 0.9331928
  [1] 567.449
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 207 | SKIPPED: 61 | WARNINGS: 5 | FAILED: 21 ]
  1. Error: formula interface works 
  2. Error: formulas work without data (@test-aggregating.R#30) 
  3. Error: var() works. (@test-aggregating.R#80) 
  4. Error: aggregatingFunctions work (@test-aggregating.R#101) 
  5. Error: aggregating functions are compatible with dplyr (@test-aggregating.R#111) 
  6. Error: bargraph works (@test-bargraph.R#8) 
  7. Error: Confidence Intervals created (@test-confint.R#131) 
  8. Error: naming as expected 
  9. Error: dimension as expected 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted