Running ‘testthat.R’ [95s/117s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(windfarmGA)
  > 
  > 
  > test_check("windfarmGA")
  ........................── 1. Failure: Test Genetic Algorithm with different Inputs (@test_ga.R#127)  ──
  any(...) isn't true.
  
  ..$Input_Data
                         [,1]                                                                                                                 
  Rotorradius            "30"                                                                                                                 
  Number of turbines     "12"                                                                                                                 
  Grid Shape Factor      "5"                                                                                                                  
  Iterations             "1"                                                                                                                  
  Mutation Rate          "0.008"                                                                                                              
  Percentage of Polygon  "1"                                                                                                                  
  Topographie            "TRUE"                                                                                                               
  Elitarism              "TRUE"                                                                                                               
  Selection Method       "FIX"                                                                                                                
  Trim Force Method Used "FALSE"                                                                                                              
  Crossover Method Used  "EQU"                                                                                                                
  Reference Height       "100"                                                                                                                
  Rotor Height           "100"                                                                                                                
  Resolution             "150"                                                                                                                
  Parallel Processing    "FALSE"                                                                                                              
  Number Clusters        "2"                                                                                                                  
  Active Weibull         "FALSE"                                                                                                              
  Grid Method            "Rectangular"                                                                                                        
  Projection             "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000\n    +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
  
  $Windspeed_Data
    ws wd
  1 12  0
  
  Topography and orography are taken into account.
  trying URL 'http://github.com/YsoSirius/windfarm_data/raw/master/clc.zip'
  Content type 'application/zip' length 72773076 bytes (69.4 MB)
  ==================================================
  downloaded 69.4 MB
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  windfarmGA
   --- call from context --- 
  barometric_height(data, height, po, ro)
   --- call from argument --- 
  if (class(data) != "data.frame") {
      data <- data.frame(data)
  }
   --- R stacktrace ---
  where 1: barometric_height(data, height, po, ro)
  where 2 at testthat/test_ga_func.R#31: BaroHoehe(data)
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_ga_func.R#13: test_that("Test Genetic Algorithm Function", {
      Polygon1 <- Polygon(rbind(c(0, 0), c(0, 2000), c(2000, 2000), 
          c(2000, 0)))
      Polygon1 <- Polygons(list(Polygon1), 1)
      Polygon1 <- SpatialPolygons(list(Polygon1))
      Projection <- "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000\n  +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
      proj4string(Polygon1) <- CRS(Projection)
      Polygon2 <- Polygon(rbind(c(0, 0), c(0, 3500), c(1500, 2000), 
          c(2000, 0)))
      Polygon2 <- Polygons(list(Polygon2), 1)
      Polygon2 <- SpatialPolygons(list(Polygon2))
      Projection <- "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000\n  +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
      proj4string(Polygon2) <- CRS(Projection)
      data <- matrix(seq(0, 5000, 500))
      res <- BaroHoehe(data)
      expect_false(anyNA(res))
      res1 <- BaroHoehe(data[, 1])
      expect_false(anyNA(res1))
      expect_true(all.equal(res, res1))
      data <- data.frame(id = sample(1:10, length(seq(0, 5000, 
          500)), replace = TRUE), elev = seq(0, 5000, 500))
      res2 <- BaroHoehe(data = data, "elev")
      expect_false(anyNA(res2))
      expect_true(all.equal(res2, res1))
      expect_error(BaroHoehe(data = data))
      rm(data, res, res1, res2)
      Grid <- GridFilter(shape = Polygon1, resol = 200, prop = 1)
      expect_is(Grid[[1]], "matrix")
      expect_is(Grid[[2]], "SpatialPolygonsDataFrame")
      expect_false(anyNA(Grid[[1]]))
      Grid <- GridFilter(shape = Polygon1, resol = 200, prop = 0.1)
      expect_is(Grid[[1]], "matrix")
      expect_is(Grid[[2]], "SpatialPolygonsDataFrame")
      expect_false(anyNA(Grid[[1]]))
      Grid <- GridFilter(shape = Polygon1, resol = 500, prop = 0.1)
      expect_is(Grid[[1]], "matrix")
      expect_is(Grid[[2]], "SpatialPolygonsDataFrame")
      expect_false(anyNA(Grid[[1]]))
      Grid <- GridFilter(shape = Polygon1, resol = 500, prop = 0)
      expect_is(Grid[[1]], "matrix")
      expect_is(Grid[[2]], "SpatialPolygonsDataFrame")
      expect_false(anyNA(Grid[[1]]))
      Grid <- GridFilter(shape = Polygon1, resol = 300, prop = 0, 
          plotGrid = TRUE)
      expect_is(Grid[[1]], "matrix")
      expect_is(Grid[[2]], "SpatialPolygonsDataFrame")
      expect_false(anyNA(Grid[[1]]))
      quiet(expect_error(GridFilter(shape = Polygon1, resol = 1e+06, 
          prop = -1)))
      Grid <- GridFilter(shape = Polygon2, resol = 300, prop = 100)
      expect_is(Grid[[1]], "matrix")
      expect_is(Grid[[2]], "SpatialPolygonsDataFrame")
      expect_false(anyNA(Grid[[1]]))
      Grid1 <- GridFilter(shape = Polygon2, resol = 300, prop = 0.1)
      expect_is(Grid1[[1]], "matrix")
      expect_is(Grid1[[2]], "SpatialPolygonsDataFrame")
      expect_false(anyNA(Grid1[[1]]))
      expect_true(nrow(Grid1[[1]]) > nrow(Grid[[1]]))
      expect_false(identical(Grid[[2]]@bbox, Grid1[[2]]@bbox))
      Grid1 <- GridFilter(shape = Polygon2, resol = 300, prop = -100)
      expect_is(Grid1[[1]], "matrix")
      expect_is(Grid1[[2]], "SpatialPolygonsDataFrame")
      expect_false(anyNA(Grid1[[1]]))
      expect_true(nrow(Grid1[[1]]) > nrow(Grid[[1]]))
      expect_false(identical(Grid[[2]]@bbox, Grid1[[2]]@bbox))
      rm(Grid1, Polygon2)
      HexGrid <- HexaTex(Polygon1, 100, FALSE)
      expect_is(HexGrid[[1]], "matrix")
      expect_is(HexGrid[[2]], "SpatialPolygons")
      expect_false(anyNA(HexGrid[[1]]))
      HexGrid <- HexaTex(Polygon1, 100, TRUE)
      expect_is(HexGrid[[1]], "matrix")
      expect_is(HexGrid[[2]], "SpatialPolygons")
      expect_false(anyNA(HexGrid[[1]]))
      HexGrid <- HexaTex(Polygon1, 200, FALSE)
      expect_is(HexGrid[[1]], "matrix")
      expect_is(HexGrid[[2]], "SpatialPolygons")
      expect_false(anyNA(HexGrid[[1]]))
      HexGrid <- HexaTex(Polygon1, 400.1, FALSE)
      expect_is(HexGrid[[1]], "matrix")
      expect_is(HexGrid[[2]], "SpatialPolygons")
      expect_false(anyNA(HexGrid[[1]]))
      HexGrid <- HexaTex(Polygon1, 1e+09, FALSE)
      expect_is(HexGrid[[1]], "matrix")
      expect_is(HexGrid[[2]], "SpatialPolygons")
      expect_false(anyNA(HexGrid[[1]]))
      rm(HexGrid)
      HexaGrid <- spatstat::hextess(windfarmGA:::owin_spatialPolygons(Polygon1), 
          s = 100)
      expect_true(class(HexaGrid)[1] == "tess")
      Hex2spdf <- tess2SPdf(HexaGrid)
      expect_is(Hex2spdf, "SpatialPolygons")
      rm(Hex2spdf, HexaGrid)
      startsel <- StartGA(Grid[[1]], n = 10, nStart = 20)
      expect_is(startsel, "list")
      expect_true(all(sapply(startsel, class) == "matrix"))
      expect_true(all(sapply(startsel, nrow) == 10))
      expect_true(all(sapply(startsel, ncol) == 4))
      expect_output(str(startsel), "List of 20")
      expect_false(any(unlist(sapply(startsel, is.na))))
      quiet(expect_error(StartGA(Grid[[1]][1:10, ], n = 10, nStart = 20)))
      quiet(expect_error(StartGA(Grid[[1]][1:10, ], n = 7, nStart = 20)))
      startsel <- StartGA(Grid[[1]], n = 20, nStart = 25)
      expect_is(startsel, "list")
      expect_true(all(sapply(startsel, class) == "matrix"))
      expect_true(all(sapply(startsel, nrow) == 20))
      expect_true(all(sapply(startsel, ncol) == 4))
      expect_output(str(startsel), "List of 25")
      expect_false(any(unlist(sapply(startsel, is.na))))
      startsel <- StartGA(Grid[[1]], n = 20, nStart = 100)
      expect_is(startsel, "list")
      expect_true(all(sapply(startsel, class) == "matrix"))
      expect_true(all(sapply(startsel, nrow) == 20))
      expect_true(all(sapply(startsel, ncol) == 4))
      expect_output(str(startsel), "List of 100")
      expect_false(any(unlist(sapply(startsel, is.na))))
      startsel <- StartGA(Grid[[1]], n = 20, nStart = 300)
      expect_is(startsel, "list")
      expect_true(all(sapply(startsel, class) == "matrix"))
      expect_true(all(sapply(startsel, nrow) == 20))
      expect_true(all(sapply(startsel, ncol) == 4))
      expect_output(str(startsel), "List of 300")
      expect_false(any(unlist(sapply(startsel, is.na))))
      startsel <- StartGA(Grid[[1]], n = 10, nStart = 20)
      expect_is(startsel, "list")
      expect_true(all(sapply(startsel, class) == "matrix"))
      expect_true(all(sapply(startsel, nrow) == 10))
      expect_true(all(sapply(startsel, ncol) == 4))
      expect_output(str(startsel), "List of 20")
      expect_false(any(unlist(sapply(startsel, is.na))))
      wind <- data.frame(ws = 12, wd = 0)
      wind <- list(wind, probab = 100)
      fit <- fitness(selection = startsel, referenceHeight = 100, 
          RotorHeight = 100, SurfaceRoughness = 0.3, Polygon = Polygon1, 
          resol1 = 200, rot = 20, dirspeed = wind, srtm_crop = "", 
          topograp = FALSE, cclRaster = "")
      expect_output(str(fit), "List of 20")
      expect_true(all(sapply(fit, nrow) == 10))
      expect_false(any(unlist(sapply(fit, is.na))))
      expect_false(any(unlist(do.call("rbind", fit)[, -c(1, 2)] < 
          0)))
      fit1 <- fitness(selection = startsel, referenceHeight = 100, 
          RotorHeight = 100, SurfaceRoughness = 0.3, Polygon = Polygon1, 
          resol1 = 200, rot = 20, dirspeed = wind, topograp = FALSE)
      expect_output(str(fit1), "List of 20")
      expect_true(all(sapply(fit1, nrow) == 10))
      expect_false(any(unlist(sapply(fit1, is.na))))
      expect_false(any(unlist(do.call("rbind", fit1)[, -c(1, 2)] < 
          0)))
      rm(fit1)
      allparks <- do.call("rbind", fit)
      selec6best <- selection1(fit, Grid[[1]], 2, TRUE, 6, "VAR")
      expect_output(str(selec6best), "List of 2")
      expect_false(any(unlist(sapply(selec6best, is.na))))
      expect_true(all(unlist(selec6best[[1]][, -1]) %in% c(0, 1)))
      expect_true(all(selec6best[[2]][, -1] > 0))
      rm(selec6best)
      fitNA <- fit
      fitNA[[1]][, "Parkfitness"] <- NA
      a <- lapply(1:length(fitNA), function(i) {
          fitNA[[i]][, "Parkfitness"] <<- NA
      })
      rm(a)
      quiet(expect_error(selection1(fitNA, Grid[[1]], 2, TRUE, 
          6, "VAR")))
      selec6best <- selection1(fit, Grid[[1]], teil = 1, TRUE, 
          6, "FIX")
      expect_output(str(selec6best), "List of 2")
      expect_false(any(unlist(sapply(selec6best, is.na))))
      expect_true(all(unlist(selec6best[[1]][, -1]) %in% c(0, 1)))
      expect_true(all(selec6best[[2]][, -1] > 0))
      rm(selec6best)
      selec6best <- selection1(fit, Grid[[1]], 2, TRUE, 6, "FIX")
      expect_output(str(selec6best), "List of 2")
      expect_false(any(unlist(sapply(selec6best, is.na))))
      expect_true(all(unlist(selec6best[[1]][, -1]) %in% c(0, 1)))
      expect_true(all(selec6best[[2]][, -1] > 0))
      rm(selec6best)
      selec6best <- selection1(fit, Grid[[1]], 2, TRUE, 6, "FIX")
      expect_output(str(selec6best), "List of 2")
      expect_false(any(unlist(sapply(selec6best, is.na))))
      expect_true(all(unlist(selec6best[[1]][, -1]) %in% c(0, 1)))
      expect_true(all(selec6best[[2]][, -1] > 0))
      rm(selec6best)
      selec6best <- quiet(selection1(fit, Grid[[1]], 4, FALSE, 
          6, selstate = "VAR", verbose = TRUE))
      expect_output(str(selec6best), "List of 2")
      expect_false(any(unlist(sapply(selec6best, is.na))))
      expect_true(all(unlist(selec6best[[1]][, -1]) %in% c(0, 1)))
      expect_true(all(selec6best[[2]][, -1] > 0))
      rm(selec6best)
      selec6best <- quiet(selection1(fit, Grid[[1]], 4, FALSE, 
          6, "FIX", verbose = TRUE))
      expect_output(str(selec6best), "List of 2")
      expect_false(any(unlist(sapply(selec6best, is.na))))
      expect_true(all(unlist(selec6best[[1]][, -1]) %in% c(0, 1)))
      expect_true(all(selec6best[[2]][, -1] > 0))
      selec6best <- quiet(selection1(fit, Grid[[1]], 4, TRUE, 6, 
          "FIX", verbose = TRUE))
      expect_output(str(selec6best), "List of 2")
      expect_false(any(unlist(sapply(selec6best, is.na))))
      expect_true(all(unlist(selec6best[[1]][, -1]) %in% c(0, 1)))
      expect_true(all(selec6best[[2]][, -1] > 0))
      crossOut <- quiet(crossover1(selec6best, 2, uplimit = 300, 
          crossPart = "RAN", verbose = TRUE))
      expect_output(str(crossOut), "num")
      expect_false(any(is.na(crossOut)))
      expect_true(all(crossOut %in% c(0, 1)))
      rm(crossOut)
      crossOut <- crossover1(selec6best, 7, uplimit = 500, crossPart = "RAN")
      expect_output(str(crossOut), "num")
      expect_false(any(is.na(crossOut)))
      expect_true(all(crossOut %in% c(0, 1)))
      rm(crossOut)
      crossOut <- quiet(crossover1(se6 = selec6best, u = 6, uplimit = 100, 
          crossPart = "EQU", seed = 105, verbose = TRUE))
      expect_output(str(crossOut), "num")
      expect_false(any(is.na(crossOut)))
      expect_true(all(crossOut %in% c(0, 1)))
      crossOut1 <- crossover1(se6 = selec6best, u = 3, uplimit = 300, 
          crossPart = "EQU", seed = 105)
      crossOut2 <- crossover1(se6 = selec6best, u = 3, uplimit = 300, 
          crossPart = "EQU", seed = 105)
      expect_true(all.equal(crossOut1, crossOut2, tolerance = 2))
      expect_output(str(crossOut1), "num")
      expect_false(any(is.na(crossOut1)))
      expect_true(all(crossOut1 %in% c(0, 1)))
      rm(crossOut, crossOut1)
      crossOut <- crossover1(se6 = selec6best, u = 7, uplimit = 500, 
          crossPart = "RAN", seed = 105)
      expect_output(str(crossOut), "num")
      expect_false(any(is.na(crossOut)))
      expect_true(all(crossOut %in% c(0, 1)))
      rm(crossOut)
      expect_error(crossover1(se6 = selec6best, u = 7, uplimit = 500, 
          crossPart = "something"))
      crossOut <- crossover1(selec6best, 3, uplimit = 300, crossPart = "EQU")
      expect_output(str(crossOut), "num")
      expect_false(any(is.na(crossOut)))
      expect_true(all(crossOut %in% c(0, 1)))
      mut <- mutation(a = crossOut, p = 0.3)
      expect_output(str(mut), "num")
      expect_false(any(is.na(mut)))
      expect_true(all(mut %in% c(0, 1)))
      mut <- mutation(a = crossOut, p = 0.1)
      expect_output(str(mut), "num")
      expect_false(any(is.na(mut)))
      expect_true(all(mut %in% c(0, 1)))
      mut <- mutation(a = crossOut, p = 1)
      expect_output(str(mut), "num")
      expect_false(any(is.na(mut)))
      expect_true(all(mut %in% c(0, 1)))
      mut <- mutation(a = crossOut, p = 100)
      expect_output(str(mut), "num")
      expect_false(any(is.na(mut)))
      expect_true(all(mut %in% c(0, 1)))
      mut <- mutation(a = crossOut, p = -1)
      expect_output(str(mut), "num")
      expect_false(any(is.na(mut)))
      expect_true(all(mut %in% c(0, 1)))
      mut <- mutation(a = crossOut, p = -1, seed = 104)
      mut1 <- mutation(a = crossOut, p = -1, seed = 104)
      expect_true(identical(mut, mut1))
      mut <- mutation(a = crossOut, p = 5e-04)
      expect_output(str(mut), "num")
      expect_false(any(is.na(mut)))
      expect_true(all(mut %in% c(0, 1)))
      mut1 <- trimton(mut = mut, nturb = 1, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = FALSE)
      expect_output(str(mut1), "num")
      expect_false(any(is.na(mut1)))
      expect_true(all(mut1 %in% c(0, 1)))
      expect_true(all(colSums(mut1) == 1))
      expect_true(all(dim(mut) == dim(mut1)))
      rm(mut1)
      mut1 <- trimton(mut = mut, nturb = min(colSums(mut)), allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = FALSE)
      expect_output(str(mut1), "num")
      expect_false(any(is.na(mut1)))
      expect_true(all(mut1 %in% c(0, 1)))
      expect_true(all(colSums(mut1) == min(colSums(mut))))
      expect_true(all(dim(mut) == dim(mut1)))
      rm(mut1)
      mut1 <- trimton(mut = mut, nturb = 10, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = FALSE)
      expect_output(str(mut1), "num")
      expect_false(any(is.na(mut1)))
      expect_true(all(mut1 %in% c(0, 1)))
      expect_true(all(colSums(mut1) == 10))
      expect_true(all(dim(mut) == dim(mut1)))
      mut1 <- trimton(mut = mut, nturb = 5, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = TRUE)
      expect_output(str(mut1), "num")
      expect_false(any(is.na(mut1)))
      expect_true(all(mut1 %in% c(0, 1)))
      expect_true(all(colSums(mut1) == 5))
      expect_true(all(dim(mut) == dim(mut1)))
      rm(mut1)
      mut1 <- trimton(mut = mut, nturb = 1, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = TRUE)
      expect_output(str(mut1), "num")
      expect_false(any(is.na(mut1)))
      expect_true(all(mut1 %in% c(0, 1)))
      expect_true(all(colSums(mut1) == 1))
      expect_true(all(dim(mut) == dim(mut1)))
      rm(mut1)
      mut1 <- trimton(mut = mut, nturb = min(colSums(mut)), allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = TRUE)
      expect_output(str(mut1), "num")
      expect_false(any(is.na(mut1)))
      expect_true(all(mut1 %in% c(0, 1)))
      expect_true(all(colSums(mut1) == min(colSums(mut))))
      expect_true(all(dim(mut) == dim(mut1)))
      rm(mut1)
      mut1 <- trimton(mut = mut, nturb = 20, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = TRUE)
      expect_output(str(mut1), "num")
      expect_false(any(is.na(mut1)))
      expect_true(all(mut1 %in% c(0, 1)))
      expect_true(all(colSums(mut1) == 20))
      expect_true(all(dim(mut) == dim(mut1)))
      mut1 <- trimton(mut = mut, nturb = 20, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = TRUE, seed = 104)
      mut2 <- trimton(mut = mut, nturb = 20, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = TRUE, seed = 104)
      expect_true(identical(mut1, mut2))
      mut1 <- trimton(mut = mut, nturb = 20, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = FALSE, seed = 234)
      mut2 <- trimton(mut = mut, nturb = 20, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = FALSE, seed = 234)
      expect_true(identical(mut1, mut2))
      mut1 <- trimton(mut = mut, nturb = 5, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = TRUE, seed = 300)
      mut2 <- trimton(mut = mut, nturb = 5, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = TRUE, seed = 300)
      expect_true(identical(mut1, mut2))
      mut1 <- trimton(mut = mut, nturb = 5, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = FALSE, seed = 234)
      mut2 <- trimton(mut = mut, nturb = 5, allparks = allparks, 
          nGrids = nrow(Grid[[1]]), trimForce = FALSE, seed = 234)
      expect_true(identical(mut1, mut2))
      getRectV <- getRects(mut1, Grid[[1]])
      expect_is(getRectV, "list")
      expect_true(all(sapply(getRectV, class) == "matrix"))
      expect_true(all(sapply(getRectV, ncol) == 3))
      expect_false(any(unlist(sapply(getRectV, is.na))))
      expect_true(all(sapply(getRectV, colnames) %in% c("ID", "X", 
          "Y")))
      fit <- fitness(selection = getRectV, referenceHeight = 100, 
          RotorHeight = 100, SurfaceRoughness = 0.3, Polygon = Polygon1, 
          resol1 = 200, rot = 20, dirspeed = wind, srtm_crop = "", 
          topograp = FALSE, cclRaster = "")
      expect_is(fit, "list")
      expect_true(length(fit) == length(getRectV))
      expect_false(any(unlist(sapply(fit, is.na))))
      expect_false(any(unlist(do.call("rbind", fit)[, -c(1, 2)] < 
          0)))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("windfarmGA")
  
   --- value of length: 2 type: logical ---
  [1] TRUE TRUE
   --- function from context --- 
  function (data, height, po = 101325, ro = 1.225) 
  {
      if (is.numeric(data) || (ncol(data)) == 1) {
          ph <- as.numeric(po * exp(-data * 0.0001252))
          rh <- as.numeric(ro * exp(-data * 0.0001252))
          Th <- as.numeric(288.15 - ((6.5 * data)/1000))
      }
      else {
          if (missing(height)) {
              stop("Height column not given.")
          }
          data <- data[, height]
          ph <- po * exp(-data * 0.0001252)
          rh <- ro * exp(-data * 0.0001252)
          Th <- 288.15 - ((6.5 * data)/1000)
      }
      if (class(data) != "data.frame") {
          data <- data.frame(data)
      }
      colnames(data) <- "Height"
      celsius <- as.numeric(Th - 273.15)
      data$ph <- ph
      data$rh <- rh
      data$tempK <- Th
      data$tempC <- celsius
      return(data)
  }
  <bytecode: 0x55edb9014318>
  <environment: namespace:windfarmGA>
   --- function search by body ---
  Function barometric_height in namespace windfarmGA has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1