Running ‘testthat.R’ [21s/58s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(antaresProcessing)
  Loading required package: antaresRead
  
  Attaching package: 'antaresProcessing'
  
  The following object is masked from 'package:testthat':
  
      compare
  
  > 
  > test_check("antaresProcessing")
  [1] "h5file is not in temp file"
  ── 1. Error: (unknown) (@test-addDownwardMargin.R#11)  ─────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: removeVirtualAreas(data, getAreas("psp")) at testthat/test-addDownwardMargin.R:11
  2: linkList[, .(connectedToHub = all(connectedToVirtualArea)), by = area]
  3: `[.data.table`(linkList, , .(connectedToHub = all(connectedToVirtualArea)), by = area)
  
  ── 2. Error: addLoadFactorLink: adds column 'loadFactor' and 'congestion' to the
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: suppressWarnings({
         readAntares(links = "all", timeStep = "annual", showProgress = FALSE, linkCapacity = TRUE)
     }) at testthat/test-addLoadFactorLink.R:8
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: readAntares(links = "all", timeStep = "annual", showProgress = FALSE, linkCapacity = TRUE) at testthat/test-addLoadFactorLink.R:8
  4: .addOutputToRes("linkCapacity", links, .importLinkCapacity, NA)
  5: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  8: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  9: lapply(pieces, .fun, ...)
  10: FUN(X[[i]], ...)
  11: outputFun(x, ...)
  12: .importInputTS(areas[2], timeStep, opts, sprintf("%s/%%s.txt", file.path("links", 
         areas[1])), colnames = names, inputTimeStep = "hourly", fun = c("sum", "sum", 
         "mean", "mean", "mean"), colSelect = colSelect)
  13: changeTimeStep(inputTS, timeStep, inputTimeStep, fun = fun)
  14: x[, mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars]
  15: `[.data.table`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  
  ── 3. Error: (unknown) (@test-addUpwardMargin.R#4)  ────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: suppressWarnings(readAntares("all", "all", select = c("H. ROR", "WIND", "SOLAR", 
         "MISC. NDG", "LOAD", "BALANCE", "AVL DTG", "ROW BAL.", "FLOW LIN."), hydroStorageMaxPower = TRUE, 
         linkCapacity = TRUE, showProgress = FALSE)) at testthat/test-addUpwardMargin.R:4
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: readAntares("all", "all", select = c("H. ROR", "WIND", "SOLAR", "MISC. NDG", "LOAD", 
         "BALANCE", "AVL DTG", "ROW BAL.", "FLOW LIN."), hydroStorageMaxPower = TRUE, 
         linkCapacity = TRUE, showProgress = FALSE)
  4: .addOutputToRes("hydroStorageMaxPower", areas, .importHydroStorageMaxPower, NA)
  5: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  8: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  9: lapply(pieces, .fun, ...)
  10: FUN(X[[i]], ...)
  11: outputFun(x, ...)
  12: .importInputTS(area, timeStep, opts, "hydro/common/capacity/maxpower_%s.txt", colnames = names, 
         inputTimeStep = "daily", fun = "mean", colSelect = colSelect)
  13: changeTimeStep(inputTS, timeStep, inputTimeStep, fun = fun)
  14: x[, mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by)]
  15: `[.data.table`(x, , mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by))
  
  ── 4. Error: (unknown) (@test-aggregateMcYears.R#5)  ───────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: describe(".aggregateMcYears", {
         mydata <- readAntares(areas = "all", mcYears = "all", showProgress = FALSE)
         .aggregateMcYears(mydata)
     }) at testthat/test-aggregateMcYears.R:5
  2: eval(substitute(code), describe_environment)
  3: eval(substitute(code), describe_environment)
  4: .aggregateMcYears(mydata) at testthat/test-aggregateMcYears.R:9
  5: x[, mapply(function(dt, f) {
         f(dt)
     }, dt = .SD, f = fun, SIMPLIFY = FALSE), by = idVars]
  6: `[.antaresDataTable`(x, , mapply(function(dt, f) {
         f(dt)
     }, dt = .SD, f = fun, SIMPLIFY = FALSE), by = idVars)
  7: NextMethod("[", x)
  8: `[.data.table`(x, , mapply(function(dt, f) {
         f(dt)
     }, dt = .SD, f = fun, SIMPLIFY = FALSE), by = idVars)
  
  ── 5. Error: externalDependency: stops if time step is not hourly (@test-externa
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: suppressWarnings(readAntares(areas = "all", timeStep = "annual", showProgress = FALSE, 
         mcYears = "all", hydroStorageMaxPower = TRUE)) at testthat/test-externalDependency.R:9
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: readAntares(areas = "all", timeStep = "annual", showProgress = FALSE, mcYears = "all", 
         hydroStorageMaxPower = TRUE)
  4: .addOutputToRes("hydroStorageMaxPower", areas, .importHydroStorageMaxPower, NA)
  5: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  8: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  9: lapply(pieces, .fun, ...)
  10: FUN(X[[i]], ...)
  11: outputFun(x, ...)
  12: .importInputTS(area, timeStep, opts, "hydro/common/capacity/maxpower_%s.txt", colnames = names, 
         inputTimeStep = "daily", fun = "mean", colSelect = colSelect)
  13: changeTimeStep(inputTS, timeStep, inputTimeStep, fun = fun)
  14: x[, mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by)]
  15: `[.data.table`(x, , mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by))
  
  ── 6. Error: externalDependency: stops if frequency exceeds a level  (@test-exte
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: suppressWarnings(readAntares(areas = "all", showProgress = FALSE, hydroStorageMaxPower = TRUE)) at testthat/test-externalDependency.R:16
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: readAntares(areas = "all", showProgress = FALSE, hydroStorageMaxPower = TRUE)
  4: .addOutputToRes("hydroStorageMaxPower", areas, .importHydroStorageMaxPower, NA)
  5: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  8: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  9: lapply(pieces, .fun, ...)
  10: FUN(X[[i]], ...)
  11: outputFun(x, ...)
  12: .importInputTS(area, timeStep, opts, "hydro/common/capacity/maxpower_%s.txt", colnames = names, 
         inputTimeStep = "daily", fun = "mean", colSelect = colSelect)
  13: changeTimeStep(inputTS, timeStep, inputTimeStep, fun = fun)
  14: x[, mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by)]
  15: `[.data.table`(x, , mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by))
  
  ── 7. Error: externalDependency: accepts 'antaresDataList' objects : areas and l
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: suppressWarnings({
         readAntares(areas = "all", links = "all", showProgress = FALSE, hydroStorageMaxPower = TRUE)
     }) at testthat/test-externalDependency.R:32
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: readAntares(areas = "all", links = "all", showProgress = FALSE, hydroStorageMaxPower = TRUE) at testthat/test-externalDependency.R:32
  4: .addOutputToRes("hydroStorageMaxPower", areas, .importHydroStorageMaxPower, NA)
  5: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  8: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  9: lapply(pieces, .fun, ...)
  10: FUN(X[[i]], ...)
  11: outputFun(x, ...)
  12: .importInputTS(area, timeStep, opts, "hydro/common/capacity/maxpower_%s.txt", colnames = names, 
         inputTimeStep = "daily", fun = "mean", colSelect = colSelect)
  13: changeTimeStep(inputTS, timeStep, inputTimeStep, fun = fun)
  14: x[, mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by)]
  15: `[.data.table`(x, , mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by))
  
  ── 8. Error: externalDependency: accepts 'antaresDataList' objects : areas and d
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: suppressWarnings({
         readAntares(areas = "all", districts = "all", showProgress = FALSE, hydroStorageMaxPower = TRUE)
     }) at testthat/test-externalDependency.R:42
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: readAntares(areas = "all", districts = "all", showProgress = FALSE, hydroStorageMaxPower = TRUE) at testthat/test-externalDependency.R:42
  4: .addOutputToRes("hydroStorageMaxPower", areas, .importHydroStorageMaxPower, NA)
  5: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  8: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  9: lapply(pieces, .fun, ...)
  10: FUN(X[[i]], ...)
  11: outputFun(x, ...)
  12: .importInputTS(area, timeStep, opts, "hydro/common/capacity/maxpower_%s.txt", colnames = names, 
         inputTimeStep = "daily", fun = "mean", colSelect = colSelect)
  13: changeTimeStep(inputTS, timeStep, inputTimeStep, fun = fun)
  14: x[, mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by)]
  15: `[.data.table`(x, , mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by))
  
  ── 9. Error: externalDependency: accepts 'antaresDataList' objects : areas, dist
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: suppressWarnings({
         readAntares(areas = "all", districts = "all", links = "all", showProgress = FALSE, 
             hydroStorageMaxPower = TRUE)
     }) at testthat/test-externalDependency.R:53
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: readAntares(areas = "all", districts = "all", links = "all", showProgress = FALSE, 
         hydroStorageMaxPower = TRUE) at testthat/test-externalDependency.R:53
  4: .addOutputToRes("hydroStorageMaxPower", areas, .importHydroStorageMaxPower, NA)
  5: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  8: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  9: lapply(pieces, .fun, ...)
  10: FUN(X[[i]], ...)
  11: outputFun(x, ...)
  12: .importInputTS(area, timeStep, opts, "hydro/common/capacity/maxpower_%s.txt", colnames = names, 
         inputTimeStep = "daily", fun = "mean", colSelect = colSelect)
  13: changeTimeStep(inputTS, timeStep, inputTimeStep, fun = fun)
  14: x[, mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by)]
  15: `[.data.table`(x, , mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by))
  
  ── 10. Error: externalDependency: works with virtual nodes (@test-externalDepend
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: suppressWarnings({
         readAntares(areas = "all", districts = "all", links = "all", showProgress = FALSE, 
             hydroStorageMaxPower = TRUE, linkCapacity = TRUE)
     }) at testthat/test-externalDependency.R:65
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: readAntares(areas = "all", districts = "all", links = "all", showProgress = FALSE, 
         hydroStorageMaxPower = TRUE, linkCapacity = TRUE) at testthat/test-externalDependency.R:65
  4: .addOutputToRes("hydroStorageMaxPower", areas, .importHydroStorageMaxPower, NA)
  5: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  8: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  9: lapply(pieces, .fun, ...)
  10: FUN(X[[i]], ...)
  11: outputFun(x, ...)
  12: .importInputTS(area, timeStep, opts, "hydro/common/capacity/maxpower_%s.txt", colnames = names, 
         inputTimeStep = "daily", fun = "mean", colSelect = colSelect)
  13: changeTimeStep(inputTS, timeStep, inputTimeStep, fun = fun)
  14: x[, mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by)]
  15: `[.data.table`(x, , mapply(function(x, f) {
         f(x, .N)
     }, x = .SD, f = ifuns[fun], SIMPLIFY = FALSE), by = eval(by))
  
  ── 11. Error: (unknown) (@test-loadFactor.R#8)  ────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: describe("loadFactor", {
         lf <- loadFactor(mydata)
         it("returns an antaresDataTable with correct number of row and columns", {
             expect_is(lf, "antaresDataTable")
             expect_true(all(c("loadFactor", "propHoursMaxGen", "propHoursMinGen") %in% 
                 names(lf)))
             expect_equal(nrow(lf)/length(simOptions()$mcYears), nrow(unique(mydata[, 
                 .(area, cluster)])))
         })
         it("returns values between 0 and 1", {
             expect_true(all(lf$loadFactor %between% c(0, 1)))
             expect_true(all(lf$propHoursMinGen %between% c(0, 1)))
             expect_true(all(lf$propHoursMaxGen %between% c(0, 1)))
             expect_true(all(lf[, propHoursMinGen + propHoursMaxGen] %between% c(0, 1)))
         })
         mydata <- readAntares(clusters = "all", thermalModulation = TRUE, mcYears = "all", 
             showProgress = FALSE, thermalAvailabilities = TRUE)
         lfA <- loadFactor(mydata, loadFactorAvailable = TRUE)
         it("returns values between 0 and 1", {
             expect_true(all(lfA$loadFactorAvailable %between% c(0, 1)))
         })
     }) at testthat/test-loadFactor.R:8
  2: eval(substitute(code), describe_environment)
  3: eval(substitute(code), describe_environment)
  4: loadFactor(mydata) at testthat/test-loadFactor.R:10
  5: changeTimeStep(res, timeStep, fun = "mean")
  6: x[, mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars]
  7: `[.antaresDataTable`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  8: NextMethod("[", x)
  9: `[.data.table`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  
  ── 12. Error: (unknown) (@test-modulation.R#6)  ────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: modulation(mydata) at testthat/test-modulation.R:6
  2: .computeModulation(tmp, timeStep, synthesis, opts)
  3: changeTimeStep(res, timeStep, fun = c("mean", "mean", "mean", "max", "max", "max"))
  4: x[, mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars]
  5: `[.antaresDataTable`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  6: NextMethod("[", x)
  7: `[.data.table`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  
  ── 13. Error: netLoadRamp: creates min and max columns only if timeStep is not h
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: netLoadRamp(x = mydata$areas, ignoreMustRun = TRUE, synthesis = TRUE) at testthat/test-netLoadRamp.R:30
  2: synthesize(x, "min", "max", prefixForMeans = "avg")
  3: x[, unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun)]
  4: `[.antaresDataTable`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  5: NextMethod("[", x)
  6: `[.data.table`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  
  ── 14. Error: surplus: returns a data.table with correct number of rows and corr
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: surplus(data, timeStep = "hourly") at testthat/test-surplus.R:23
  2: cong[, .(congestionFees = sum(congestionFees)/2), keyby = idColsA]
  3: `[.data.table`(cong, , .(congestionFees = sum(congestionFees)/2), keyby = idColsA)
  
  ── 15. Error: Surpluses are correctly computed (@test-surplus.R#32)  ───────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: removeVirtualAreas(data, storageFlexibility = getAreas(c("psp", "hub")), production = getAreas("offshore")) at testthat/test-surplus.R:32
  2: linkList[, .(connectedToHub = all(connectedToVirtualArea)), by = area]
  3: `[.data.table`(linkList, , .(connectedToHub = all(connectedToVirtualArea)), by = area)
  
  ── 16. Error: surplusClusters: stops if synthetic or not hourly results (@test-s
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: readAntares(areas = "all", clusters = "all", select = "MRG. PRICE", showProgress = FALSE, 
         mcYears = "all", timeStep = "annual", thermalAvailabilities = TRUE) at testthat/test-surplusClusters.R:17
  2: .addOutputToRes("thermalAvailabilities", clusters, .importThermal, NA)
  3: suppressWarnings(llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, 
         mcYears = mcYears, timeStep = ts, opts = opts, select = select, colSelect = colSelect, 
         names = names, unselect = unselect, .progress = ifelse(showProgress, "text", 
             "none"), .parallel = parallel, .paropts = list(.packages = "antaresRead")))
  4: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  5: llply(ids, function(x, ...) outputFun(x, ...), synthesis = synthesis, mcYears = mcYears, 
         timeStep = ts, opts = opts, select = select, colSelect = colSelect, names = names, 
         unselect = unselect, .progress = ifelse(showProgress, "text", "none"), .parallel = parallel, 
         .paropts = list(.packages = "antaresRead"))
  6: structure(lapply(pieces, .fun, ...), dim = dim(pieces))
  7: lapply(pieces, .fun, ...)
  8: FUN(X[[i]], ...)
  9: outputFun(x, ...)
  10: changeTimeStep(series, timeStep, "hourly", opts = opts, fun = c("sum", "mean"))
  11: x[, mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars]
  12: `[.data.table`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  
  ── 17. Error: surplusClusters: returns an antaresDataTable with correct number o
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: surplusClusters(data) at testthat/test-surplusClusters.R:24
  2: changeTimeStep(res, timeStep)
  3: x[, mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars]
  4: `[.antaresDataTable`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  5: NextMethod("[", x)
  6: `[.data.table`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  
  ── 18. Error: All cluster surpluses are positive, except for must run clusters (
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: surplusClusters(data) at testthat/test-surplusClusters.R:32
  2: changeTimeStep(res, timeStep)
  3: x[, mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars]
  4: `[.antaresDataTable`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  5: NextMethod("[", x)
  6: `[.data.table`(x, , mapply(function(x, f) {
         f(x)
     }, x = .SD, f = funs[fun], SIMPLIFY = FALSE), keyby = idVars)
  
  ── 19. Error: (unknown) (@test-surplusSectors.R#8)  ────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: surplusSectors(mydata) at testthat/test-surplusSectors.R:8
  2: surplusThermal[, .(surplus = sum(totalSurplus), cost = sum(variableCost + fixedCost + 
         startupCost)), by = c(idVars, "sector")]
  3: `[.antaresDataTable`(surplusThermal, , .(surplus = sum(totalSurplus), cost = sum(variableCost + 
         fixedCost + startupCost)), by = c(idVars, "sector"))
  4: NextMethod("[", x)
  5: `[.data.table`(surplusThermal, , .(surplus = sum(totalSurplus), cost = sum(variableCost + 
         fixedCost + startupCost)), by = c(idVars, "sector"))
  
  ── 20. Error: synthesize: computes custom variables asked using aliases (@test-s
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: synthesize(mydata$areas, "min", "max") at testthat/test-synthesize.R:30
  2: x[, unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun)]
  3: `[.antaresDataTable`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  4: NextMethod("[", x)
  5: `[.data.table`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  
  ── 21. Error: synthesize: computes custom variables asked using functions (@test
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: synthesize(mydata$areas, log = function(x) mean(log(1 + x))) at testthat/test-synthesize.R:35
  2: x[, unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun)]
  3: `[.antaresDataTable`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  4: NextMethod("[", x)
  5: `[.data.table`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  
  ── 22. Error: synthesize: computes custom variables asked using lists (@test-syn
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: synthesize(mydata$areas, log = list(fun = function(x) mean(log(1 + x)))) at testthat/test-synthesize.R:40
  2: x[, unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun)]
  3: `[.antaresDataTable`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  4: NextMethod("[", x)
  5: `[.data.table`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  
  ── 23. Error: synthesize: can compute custom statistics for only some columns (@
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: synthesize(mydata$areas, log = list(fun = function(x) mean(log(1 + x)), only = "LIGNITE")) at testthat/test-synthesize.R:46
  2: x[, unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun)]
  3: `[.antaresDataTable`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  4: NextMethod("[", x)
  5: `[.data.table`(x, , unname(as.list(do.call(c, mapply(function(v, funs) {
         lapply(funs, function(f) f(v))
     }, v = .SD, funs = aggFun)))), keyby = idVars, .SDcols = names(aggFun))
  
  ── 24. Error: thermalGroupCapacities calc (@test-thermalGroupCapacities.R#7)  ──
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: thermalGroupCapacities(opts) at testthat/test-thermalGroupCapacities.R:7
  2: clDesc[, list(thermalGroupCapacities = sum(unitcount * nominalcapacity)), by = c("area", 
         "group")]
  3: `[.data.table`(clDesc, , list(thermalGroupCapacities = sum(unitcount * nominalcapacity)), 
         by = c("area", "group"))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 78 SKIPPED: 0 FAILED: 24
  1. Error: (unknown) (@test-addDownwardMargin.R#11) 
  2. Error: addLoadFactorLink: adds column 'loadFactor' and 'congestion' to the input data (@test-addLoadFactorLink.R#8) 
  3. Error: (unknown) (@test-addUpwardMargin.R#4) 
  4. Error: (unknown) (@test-aggregateMcYears.R#5) 
  5. Error: externalDependency: stops if time step is not hourly (@test-externalDependency.R#9) 
  6. Error: externalDependency: stops if frequency exceeds a level  (@test-externalDependency.R#16) 
  7. Error: externalDependency: accepts 'antaresDataList' objects : areas and links (@test-externalDependency.R#32) 
  8. Error: externalDependency: accepts 'antaresDataList' objects : areas and districts (@test-externalDependency.R#42) 
  9. Error: externalDependency: accepts 'antaresDataList' objects : areas, districts and links (@test-externalDependency.R#53) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted