Running 'testthat.R' [4s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(mmetrics)
  > 
  > test_check("mmetrics")
  -- 1. Error: summarize one key (@test-mmetrics.R#16)  --------------------------
  Problem with `summarise()` input `count`.
  x could not find function "n"
  i Input `count` is `n()`.
  i The error occured in group 1: gender = "F".
  Backtrace:
    1. dplyr::group_by(df, gender)
    9. dplyr::summarise(., !!!metrics)
   11. dplyr:::summarise_cols(.data, ...)
  
  -- 2. Error: summarize two keys (@test-mmetrics.R#21)  -------------------------
  Problem with `summarise()` input `count`.
  x could not find function "n"
  i Input `count` is `n()`.
  i The error occured in group 1: gender = "F", age = 20.
  Backtrace:
    1. dplyr::group_by(df, gender, age)
    9. dplyr::summarise(., !!!metrics)
   11. dplyr:::summarise_cols(.data, ...)
  
  -- 3. Error: summarize all (@test-mmetrics.R#26)  ------------------------------
  Problem with `summarise()` input `count`.
  x could not find function "n"
  i Input `count` is `n()`.
  Backtrace:
   1. dplyr::summarise(df, !!!metrics)
   2. dplyr:::summarise.data.frame(df, !!!metrics)
   3. dplyr:::summarise_cols(.data, ...)
  
  -- 4. Error: mutate one key (@test-mmetrics.R#31)  -----------------------------
  Problem with `mutate()` input `count`.
  x could not find function "n"
  i Input `count` is `n()`.
  i The error occured in group 1: gender = "F".
  Backtrace:
    1. dplyr::group_by(df, gender)
    9. dplyr::mutate(., !!!metrics)
   11. dplyr:::mutate_cols(.data, ...)
  
  -- 5. Error: mutate two keys (@test-mmetrics.R#36)  ----------------------------
  Problem with `mutate()` input `count`.
  x could not find function "n"
  i Input `count` is `n()`.
  i The error occured in group 1: gender = "F", age = 20.
  Backtrace:
    1. dplyr::group_by(df, gender, age)
    9. dplyr::mutate(., !!!metrics)
   11. dplyr:::mutate_cols(.data, ...)
  
  -- 6. Error: mutate all with (@test-mmetrics.R#41)  ----------------------------
  Problem with `mutate()` input `count`.
  x could not find function "n"
  i Input `count` is `n()`.
  Backtrace:
   1. dplyr::mutate(df, !!!metrics)
   2. dplyr:::mutate.data.frame(df, !!!metrics)
   3. dplyr:::mutate_cols(.data, ...)
  
  -- 7. Failure: mutate with non summarize mode to evaluate ratio (@test-mmetrics.
  add(df, gender, metrics = metrics, summarize = FALSE) not equal to `df_expected`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component "class": Lengths (3, 4) differ (string compare on first 3) >
  Attributes: < Component "class": 3 string mismatches >
  Attributes: < Component 2: Modes: numeric, list >
  Attributes: < Component 2: Lengths: 10, 2 >
  Attributes: < Component 2: names for current but not for target >
  Attributes: < Component 2: Attributes: < target is NULL, current is list > >
  Attributes: < Component 2: target is numeric, current is tbl_df >
  
  -- 8. Failure: not evaluatable metrics must be removed without error (@test-mmet
  add(df, gender, metrics = metrics, summarize = FALSE) not equal to `df_expected`.
  Attributes: < Names: 1 string mismatch >
  Attributes: < Length mismatch: comparison on first 2 components >
  Attributes: < Component "class": Lengths (3, 4) differ (string compare on first 3) >
  Attributes: < Component "class": 3 string mismatches >
  Attributes: < Component 2: Modes: numeric, list >
  Attributes: < Component 2: Lengths: 10, 2 >
  Attributes: < Component 2: names for current but not for target >
  Attributes: < Component 2: Attributes: < target is NULL, current is list > >
  Attributes: < Component 2: target is numeric, current is tbl_df >
  
  -- 9. Error: not evaluatable metrics must be removed without error (@test-mmetri
  Problem with `summarise()` input `count`.
  x could not find function "n"
  i Input `count` is `n()`.
  i The error occured in group 1: gender = "F".
  Backtrace:
    1. dplyr::group_by(df, gender)
    9. dplyr::summarize(., count = n(), cost = sum(cost), ctr = sum(click)/sum(impression))
   11. dplyr:::summarise_cols(.data, ...)
  
  == testthat results  ===========================================================
  [ OK: 12 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 9 ]
  1. Error: summarize one key (@test-mmetrics.R#16) 
  2. Error: summarize two keys (@test-mmetrics.R#21) 
  3. Error: summarize all (@test-mmetrics.R#26) 
  4. Error: mutate one key (@test-mmetrics.R#31) 
  5. Error: mutate two keys (@test-mmetrics.R#36) 
  6. Error: mutate all with (@test-mmetrics.R#41) 
  7. Failure: mutate with non summarize mode to evaluate ratio (@test-mmetrics.R#48) 
  8. Failure: not evaluatable metrics must be removed without error (@test-mmetrics.R#55) 
  9. Error: not evaluatable metrics must be removed without error (@test-mmetrics.R#63) 
  
  Error: testthat unit tests failed
  Execution halted