Running ‘testthat.R’ [8s/8s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(otvPlots)
  > 
  > test_check("otvPlots")
  ── 1. Error: expected plot elements are returned (@test_PlotBarplot.R#10)  ─────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: PlotBarplot(dataFl = testData, myVar = "job", weightNm = "weight") at testthat/test_PlotBarplot.R:10
  2: dataSub[, list(count = sum(get(weightNm))), by = myVar]
  3: `[.data.table`(dataSub, , list(count = sum(get(weightNm))), by = myVar)
  
  ── 2. Error: variable is put in expected order with and without weights (@test_P
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: PlotBarplot(dataFl = testData, myVar = "job", weightNm = "weight") at testthat/test_PlotBarplot.R:25
  2: dataSub[, list(count = sum(get(weightNm))), by = myVar]
  3: `[.data.table`(dataSub, , list(count = sum(get(weightNm))), by = myVar)
  
  ── 3. Error: global totals are calculated as expected (@test_PlotBarplot.R#37)  
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: PlotBarplot(dataFl = testData, myVar = "job", weightNm = "weight") at testthat/test_PlotBarplot.R:37
  2: dataSub[, list(count = sum(get(weightNm))), by = myVar]
  3: `[.data.table`(dataSub, , list(count = sum(get(weightNm))), by = myVar)
  
  ── 4. Error: PlotNumVar returns a gtable (@test_PlotNumVar.R#9)  ───────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: PlotNumVar("age", testData, NULL, "weeks", "months", skewOpt = 3, kSample = NULL) at testthat/test_PlotNumVar.R:9
  2: SummaryStats(myVar = myVar, dataFl = dataFl, dateGp = dateGp, weightNm = weightNm)
  3: dataFl[, {
         tmp1 <- quantile(get(myVar), probs = c(0.01, 0.25, 0.5, 0.75, 0.99), na.rm = TRUE)
         list(p1 = tmp1[1], p25 = tmp1[2], p50 = tmp1[3], p75 = tmp1[4], p99 = tmp1[5], 
             mean = as.double(mean(get(myVar), na.rm = TRUE)), sd = as.double(sd(get(myVar), 
                 na.rm = TRUE)), zerorate = mean(get(myVar) == 0, na.rm = TRUE), missingrate = mean(is.na(get(myVar))))
     }, by = c(dateGp)]
  4: `[.data.table`(dataFl, , {
         tmp1 <- quantile(get(myVar), probs = c(0.01, 0.25, 0.5, 0.75, 0.99), na.rm = TRUE)
         list(p1 = tmp1[1], p25 = tmp1[2], p50 = tmp1[3], p75 = tmp1[4], p99 = tmp1[5], 
             mean = as.double(mean(get(myVar), na.rm = TRUE)), sd = as.double(sd(get(myVar), 
                 na.rm = TRUE)), zerorate = mean(get(myVar) == 0, na.rm = TRUE), missingrate = mean(is.na(get(myVar))))
     }, by = c(dateGp))
  
  ── 5. Error: (unknown) (@test_PlotQuantiles.R#8)  ──────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: testData[, {
         tmp1 = quantile(balance, p = c(0.01, 0.5, 0.99))
         list(p1 = tmp1[1], p50 = tmp1[2], p99 = tmp1[3])
     }, by = "weeks"] at testthat/test_PlotQuantiles.R:8
  2: `[.data.table`(testData, , {
         tmp1 = quantile(balance, p = c(0.01, 0.5, 0.99))
         list(p1 = tmp1[1], p50 = tmp1[2], p99 = tmp1[3])
     }, by = "weeks") at testthat/test_PlotQuantiles.R:8
  
  ── 6. Error: (unknown) (@test_PlotRates.R#8)  ──────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: testData[, {
         list(zerorate = mean(balance == 0), missingrate = mean(is.na(balance)))
     }, by = "weeks"] at testthat/test_PlotRates.R:8
  2: `[.data.table`(testData, , {
         list(zerorate = mean(balance == 0), missingrate = mean(is.na(balance)))
     }, by = "weeks") at testthat/test_PlotRates.R:8
  
  ── 7. Error: (unknown) (@test_PlotRatesOverTime.R#9)  ──────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: PlotRatesOverTime(dataFl = testData, dateGp = "weeks", myVar = "job", weightNm = "weight", 
         newLevels = NULL) at testthat/test_PlotRatesOverTime.R:9
  2: dataSub[, list(count = sum(get(weightNm))), by = myVar]
  3: `[.data.table`(dataSub, , list(count = sum(get(weightNm))), by = myVar)
  
  ── 8. Error: Numerical statistics are calculated correctly without weight (@test
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: SummaryStats(myVar = "age", dataFl = testData, dateGp = "weeks") at testthat/test_SummaryStats.R:8
  2: dataFl[, {
         tmp1 <- quantile(get(myVar), probs = c(0.01, 0.25, 0.5, 0.75, 0.99), na.rm = TRUE)
         list(p1 = tmp1[1], p25 = tmp1[2], p50 = tmp1[3], p75 = tmp1[4], p99 = tmp1[5], 
             mean = as.double(mean(get(myVar), na.rm = TRUE)), sd = as.double(sd(get(myVar), 
                 na.rm = TRUE)), zerorate = mean(get(myVar) == 0, na.rm = TRUE), missingrate = mean(is.na(get(myVar))))
     }, by = c(dateGp)]
  3: `[.data.table`(dataFl, , {
         tmp1 <- quantile(get(myVar), probs = c(0.01, 0.25, 0.5, 0.75, 0.99), na.rm = TRUE)
         list(p1 = tmp1[1], p25 = tmp1[2], p50 = tmp1[3], p75 = tmp1[4], p99 = tmp1[5], 
             mean = as.double(mean(get(myVar), na.rm = TRUE)), sd = as.double(sd(get(myVar), 
                 na.rm = TRUE)), zerorate = mean(get(myVar) == 0, na.rm = TRUE), missingrate = mean(is.na(get(myVar))))
     }, by = c(dateGp))
  
  ── 9. Error: Numerical statistics are calculated correctly with weight (@test_Su
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: SummaryStats(myVar = "age", dataFl = testData, dateGp = "weeks", weightNm = "weight") at testthat/test_SummaryStats.R:37
  2: dataFl[, {
         tmp1 <- wtd_quantile_NA(get(myVar), get(weightNm), c(0.01, 0.25, 0.5, 0.75, 0.99))
         list(p1 = tmp1[1], p25 = tmp1[2], p50 = tmp1[3], p75 = tmp1[4], p99 = tmp1[5], 
             mean = as.double(Hmisc::wtd.mean(get(myVar), get(weightNm), normwt = TRUE, 
                 na.rm = TRUE)), sd = as.double(sqrt(Hmisc::wtd.var(get(myVar), get(weightNm), 
                 normwt = TRUE, na.rm = TRUE))), zerorate = Hmisc::wtd.mean(get(myVar) == 
                 0, get(weightNm), na.rm = TRUE, normwt = TRUE), missingrate = Hmisc::wtd.mean(is.na(get(myVar)), 
                 get(weightNm), normwt = TRUE))
     }, by = c(dateGp)]
  3: `[.data.table`(dataFl, , {
         tmp1 <- wtd_quantile_NA(get(myVar), get(weightNm), c(0.01, 0.25, 0.5, 0.75, 0.99))
         list(p1 = tmp1[1], p25 = tmp1[2], p50 = tmp1[3], p75 = tmp1[4], p99 = tmp1[5], 
             mean = as.double(Hmisc::wtd.mean(get(myVar), get(weightNm), normwt = TRUE, 
                 na.rm = TRUE)), sd = as.double(sqrt(Hmisc::wtd.var(get(myVar), get(weightNm), 
                 normwt = TRUE, na.rm = TRUE))), zerorate = Hmisc::wtd.mean(get(myVar) == 
                 0, get(weightNm), na.rm = TRUE, normwt = TRUE), missingrate = Hmisc::wtd.mean(is.na(get(myVar)), 
                 get(weightNm), normwt = TRUE))
     }, by = c(dateGp))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 138 SKIPPED: 0 FAILED: 9
  1. Error: expected plot elements are returned (@test_PlotBarplot.R#10) 
  2. Error: variable is put in expected order with and without weights (@test_PlotBarplot.R#25) 
  3. Error: global totals are calculated as expected (@test_PlotBarplot.R#37) 
  4. Error: PlotNumVar returns a gtable (@test_PlotNumVar.R#9) 
  5. Error: (unknown) (@test_PlotQuantiles.R#8) 
  6. Error: (unknown) (@test_PlotRates.R#8) 
  7. Error: (unknown) (@test_PlotRatesOverTime.R#9) 
  8. Error: Numerical statistics are calculated correctly without weight (@test_SummaryStats.R#8) 
  9. Error: Numerical statistics are calculated correctly with weight (@test_SummaryStats.R#37) 
  
  Error: testthat unit tests failed
  Execution halted