CRAN Package Check Results for Package windfarmGA

Last updated on 2019-11-26 00:52:17 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 2.2.2 43.37 332.08 375.45 ERROR
r-devel-linux-x86_64-debian-gcc 2.2.2 35.11 239.75 274.86 ERROR
r-devel-linux-x86_64-fedora-clang 2.2.2 624.16 OK
r-devel-linux-x86_64-fedora-gcc 2.2.2 648.95 OK
r-devel-windows-ix86+x86_64 2.2.2 127.00 1126.00 1253.00 OK
r-devel-windows-ix86+x86_64-gcc8 2.2.2 93.00 952.00 1045.00 OK
r-patched-linux-x86_64 2.2.2 39.67 442.36 482.03 OK
r-patched-solaris-x86 2.2.2 767.80 OK
r-release-linux-x86_64 2.2.2 35.07 423.05 458.12 OK
r-release-windows-ix86+x86_64 2.2.2 116.00 984.00 1100.00 OK
r-release-osx-x86_64 2.2.2 OK
r-oldrel-windows-ix86+x86_64 2.2.2 54.00 690.00 744.00 ERROR
r-oldrel-osx-x86_64 2.2.2 OK

Check Details

Version: 2.2.2
Check: examples
Result: ERROR
    Running examples in 'windfarmGA-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: barometric_height
    > ### Title: Calculates Air Density, Air Pressure and Temperature according
    > ### to the Barometric Height Formula
    > ### Aliases: barometric_height
    >
    > ### ** Examples
    >
    > data <- matrix(seq(0,5000,500));
    > barometric_height(data)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    windfarmGA
     --- call from context ---
    barometric_height(data)
     --- call from argument ---
    if (class(data) != "data.frame") {
     data <- data.frame(data)
    }
     --- R stacktrace ---
    where 1: barometric_height(data)
    
     --- 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: 0xbe8a9b0>
    <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
Flavor: r-devel-linux-x86_64-debian-clang

Version: 2.2.2
Check: tests
Result: ERROR
     Running 'testthat.R' [132s/145s]
    Running the tests in 'tests/testthat.R' failed.
    Complete output:
     > library(testthat)
     > library(windfarmGA)
     >
     >
     > test_check("windfarmGA")
     ........$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: 0x127db870>
     <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
Flavor: r-devel-linux-x86_64-debian-clang

Version: 2.2.2
Check: examples
Result: ERROR
    Running examples in ‘windfarmGA-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: barometric_height
    > ### Title: Calculates Air Density, Air Pressure and Temperature according
    > ### to the Barometric Height Formula
    > ### Aliases: barometric_height
    >
    > ### ** Examples
    >
    > data <- matrix(seq(0,5000,500));
    > barometric_height(data)
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    windfarmGA
     --- call from context ---
    barometric_height(data)
     --- call from argument ---
    if (class(data) != "data.frame") {
     data <- data.frame(data)
    }
     --- R stacktrace ---
    where 1: barometric_height(data)
    
     --- 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: 0x562cca7aa398>
    <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
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 2.2.2
Check: tests
Result: ERROR
     Running ‘testthat.R’ [88s/110s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(windfarmGA)
     >
     >
     > test_check("windfarmGA")
     .......$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: 0x5631f2f8b2b0>
     <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
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 2.2.2
Check: running tests for arch ‘i386’
Result: ERROR
     Running 'testthat.R' [276s]
    Running the tests in 'tests/testthat.R' failed.
    Complete output:
     > library(testthat)
     > library(windfarmGA)
     >
     >
     > test_check("windfarmGA")
     ........$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'
     .[1] "plot_result: Plot the 'best' Individuals of the GA:"
     N different optimal configurations: 98
     Amount duplicates: 102
     Plot 1 Best Energy Solution:
     Press [enter] to continue
     [1] "plot_evolution: Plot the Evolution of the Efficiency and Energy Values:"
     [1] "plot_parkfitness: Plot the Influence of Population Size, Selection, Crossover, Mutation:"
     Press [enter] to continue
     [1] "plot_fitness_evolution: Plot the Changes in Fitness Values:"
     Press [enter] to continue
     [1] "plot_cloud: Plot all individual Values of the whole Evolution:"
     Press [enter] to continue
     [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
     [inverse distance weighted interpolation]
     Cannot plot option 2,3,4,5.
     Only option 1,6 are available.[1] "plot_result: Plot the 'best' Individuals of the GA:"
     N different optimal configurations: 3
     Amount duplicates: 0
     Plot 1 Best Energy Solution:
     Press [enter] to continue
     [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
     [inverse distance weighted interpolation]
     Cannot plot option 2,3,4,5.
     Only option 1,6 are available.[1] "plot_result: Plot the 'best' Individuals of the GA:"
     N different optimal configurations: 3
     Amount duplicates: 0
     Plot 1 Best Energy Solution:
     Press [enter] to continue
     [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
     [inverse distance weighted interpolation]
     [1] "plot_result: Plot the 'best' Individuals of the GA:"
     N different optimal configurations: 9
     Amount duplicates: 1
     Plot 2 Best Energy Solution:
    
     Plot 1 Best Energy Solution:
     Press [enter] to continue
     [1] "plot_evolution: Plot the Evolution of the Efficiency and Energy Values:"
     [1] "plot_parkfitness: Plot the Influence of Population Size, Selection, Crossover, Mutation:"
     Press [enter] to continue
     [1] "plot_fitness_evolution: Plot the Changes in Fitness Values:"
     Press [enter] to continue
     [1] "plot_cloud: Plot all individual Values of the whole Evolution:"
     Press [enter] to continue
     [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
     [inverse distance weighted interpolation]
     [inverse distance weighted interpolation]
     [inverse distance weighted interpolation]
     [inverse distance weighted interpolation]
     Maximum possible number for 'which': 10.$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'
     -- 1. Error: Test Terrain and Weibull Effects (@test_terrain.R#39) ------------
     cannot open URL 'http://github.com/YsoSirius/windfarm_data/raw/master/clc.zip'
     Backtrace:
     1. windfarmGA::genAlgo(...)
     2. windfarmGA::genetic_algorithm(...)
     3. utils::download.file(...)
    
     [1] "ABBREV" "ADM0_A3" "ADM0_DIF" "ADMIN" "ADMIN.1"
     [6] "AVOIDname" "AVOIDnumeric" "FIPS_10_" "FeatureCla" "GBD"
     [11] "GDP_MD_EST" "GEO3" "GEO3major" "GEOUNIT" "GEOU_DIF"
     [16] "GLOCAF" "GU_A3" "IMAGE24" "ISO3" "ISO3.1"
     [21] "ISO_A2" "ISO_A3" "ISO_N3" "LAT" "LDC"
     [26] "LEVEL" "LLDC" "LON" "LabelRank" "MAP_COLOR"
     [31] "NAME" "NAME_FORMA" "NAME_SORT" "POP_EST" "POSTAL"
     [36] "REGION" "SID" "SOVEREIGNT" "SOV_A3" "SRES"
     [41] "SRESmajor" "SUBUNIT" "SU_A3" "SU_DIF" "ScaleRank"
     [46] "Stern" "TERR_" "TYPE" "continent"
     Enter an ISO3 code: [1] "ABBREV" "ADM0_A3" "ADM0_DIF" "ADMIN" "ADMIN.1"
     [6] "AVOIDname" "AVOIDnumeric" "FIPS_10_" "FeatureCla" "GBD"
     [11] "GDP_MD_EST" "GEO3" "GEO3major" "GEOUNIT" "GEOU_DIF"
     [16] "GLOCAF" "GU_A3" "IMAGE24" "ISO3" "ISO3.1"
     [21] "ISO_A2" "ISO_A3" "ISO_N3" "LAT" "LDC"
     [26] "LEVEL" "LLDC" "LON" "LabelRank" "MAP_COLOR"
     [31] "NAME" "NAME_FORMA" "NAME_SORT" "POP_EST" "POSTAL"
     [36] "REGION" "SID" "SOVEREIGNT" "SOV_A3" "SRES"
     [41] "SRESmajor" "SUBUNIT" "SU_A3" "SU_DIF" "ScaleRank"
     [46] "Stern" "TERR_" "TYPE" "continent"
     Enter an ISO3 code: Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
    
     Hit <ENTER> if this is your Polygon
     No Projection is given. Take Lambert Azimuthal Equal Area Projection.
    
     Hit <ENTER> if this is your Polygon
    
     Select appropriate Method. Either 'EQU' for equal crossover parts or 'RAN' for random parts.
     Type 'R' for random and 'E' for equal parts.
    
     Select appropriate Method. Either 'EQU' for equal crossover parts or 'RAN' for random parts.
     Type 'R' for random and 'E' for equal parts.
    
     Select appropriate Selection Method. Either 'FIX' or 'VAR' are available.
     Type 'F' for a fixed percentage of 50% and 'V' for a variable percentage.
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs.################### GA WARNING MESSAGE ###################
     Hit <ENTER> if this is your Polygon
     No Projection is given. Take Lambert Azimuthal Equal Area Projection.
    
     Hit <ENTER> if this is your Polygon
    
     Select appropriate Method. Either 'EQU' for equal crossover parts or 'RAN' for random parts.
     Type 'R' for random and 'E' for equal parts.
    
     Select appropriate Method. Either 'EQU' for equal crossover parts or 'RAN' for random parts.
     Type 'R' for random and 'E' for equal parts.
    
     Select appropriate Selection Method. Either 'FIX' or 'VAR' are available.
     Type 'F' for a fixed percentage of 50% and 'V' for a variable percentage.
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs....trying URL 'https://biogeo.ucdavis.edu/data/diva/msk_alt/AUT_msk_alt.zip'
     Content type 'application/zip' length 216165 bytes (211 KB)
     ==================================================
     downloaded 211 KB
    
    
     Hit <ENTER> if this is your Polygon
     No Projection is given. Take Lambert Azimuthal Equal Area Projection.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs......OGR data source with driver: ESRI Shapefile
     Source: "D:\temp\Rtmp0Eeljr\RLIBS_15a202de336c7\windfarmGA\extdata\shape.shp", layer: "shape"
     with 1 features
     It has 1 fields
    
     Hit <ENTER> if this is your Polygon
     No Projection is given. Take Lambert Azimuthal Equal Area Projection.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs....
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs......
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs......
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
     ################### GA WARNING MESSAGE ###################
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
     ################### GA WARNING MESSAGE ###################
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs.weibullsrc class:
     1 - data.frame
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs.list item classes:
     1 - numeric
     2 - numeric== testthat results ===========================================================
     [ OK: 766 | SKIPPED: 2 | WARNINGS: 149 | FAILED: 1 ]
     1. Error: Test Terrain and Weibull Effects (@test_terrain.R#39)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-oldrel-windows-ix86+x86_64

Version: 2.2.2
Check: running tests for arch ‘x64’
Result: ERROR
     Running 'testthat.R' [307s]
    Running the tests in 'tests/testthat.R' failed.
    Complete output:
     > library(testthat)
     > library(windfarmGA)
     >
     >
     > test_check("windfarmGA")
     .......$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'
     ...[1] "plot_result: Plot the 'best' Individuals of the GA:"
     N different optimal configurations: 98
     Amount duplicates: 102
     Plot 1 Best Energy Solution:
     Press [enter] to continue
     [1] "plot_evolution: Plot the Evolution of the Efficiency and Energy Values:"
     [1] "plot_parkfitness: Plot the Influence of Population Size, Selection, Crossover, Mutation:"
     Press [enter] to continue
     [1] "plot_fitness_evolution: Plot the Changes in Fitness Values:"
     Press [enter] to continue
     [1] "plot_cloud: Plot all individual Values of the whole Evolution:"
     Press [enter] to continue
     [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
     [inverse distance weighted interpolation]
     Cannot plot option 2,3,4,5.
     Only option 1,6 are available.[1] "plot_result: Plot the 'best' Individuals of the GA:"
     N different optimal configurations: 3
     Amount duplicates: 0
     Plot 1 Best Energy Solution:
     Press [enter] to continue
     [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
     [inverse distance weighted interpolation]
     Cannot plot option 2,3,4,5.
     Only option 1,6 are available.[1] "plot_result: Plot the 'best' Individuals of the GA:"
     N different optimal configurations: 3
     Amount duplicates: 0
     Plot 1 Best Energy Solution:
     Press [enter] to continue
     [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
     [inverse distance weighted interpolation]
     [1] "plot_result: Plot the 'best' Individuals of the GA:"
     N different optimal configurations: 9
     Amount duplicates: 1
     Plot 2 Best Energy Solution:
    
     Plot 1 Best Energy Solution:
     Press [enter] to continue
     [1] "plot_evolution: Plot the Evolution of the Efficiency and Energy Values:"
     [1] "plot_parkfitness: Plot the Influence of Population Size, Selection, Crossover, Mutation:"
     Press [enter] to continue
     [1] "plot_fitness_evolution: Plot the Changes in Fitness Values:"
     Press [enter] to continue
     [1] "plot_cloud: Plot all individual Values of the whole Evolution:"
     Press [enter] to continue
     [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
     [inverse distance weighted interpolation]
     [inverse distance weighted interpolation]
     [inverse distance weighted interpolation]
     [inverse distance weighted interpolation]
     Maximum possible number for 'which': 10.$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'
     -- 1. Error: Test Terrain and Weibull Effects (@test_terrain.R#39) ------------
     cannot open URL 'http://github.com/YsoSirius/windfarm_data/raw/master/clc.zip'
     Backtrace:
     1. windfarmGA::genAlgo(...)
     2. windfarmGA::genetic_algorithm(...)
     3. utils::download.file(...)
    
     [1] "ABBREV" "ADM0_A3" "ADM0_DIF" "ADMIN" "ADMIN.1"
     [6] "AVOIDname" "AVOIDnumeric" "FIPS_10_" "FeatureCla" "GBD"
     [11] "GDP_MD_EST" "GEO3" "GEO3major" "GEOUNIT" "GEOU_DIF"
     [16] "GLOCAF" "GU_A3" "IMAGE24" "ISO3" "ISO3.1"
     [21] "ISO_A2" "ISO_A3" "ISO_N3" "LAT" "LDC"
     [26] "LEVEL" "LLDC" "LON" "LabelRank" "MAP_COLOR"
     [31] "NAME" "NAME_FORMA" "NAME_SORT" "POP_EST" "POSTAL"
     [36] "REGION" "SID" "SOVEREIGNT" "SOV_A3" "SRES"
     [41] "SRESmajor" "SUBUNIT" "SU_A3" "SU_DIF" "ScaleRank"
     [46] "Stern" "TERR_" "TYPE" "continent"
     Enter an ISO3 code: [1] "ABBREV" "ADM0_A3" "ADM0_DIF" "ADMIN" "ADMIN.1"
     [6] "AVOIDname" "AVOIDnumeric" "FIPS_10_" "FeatureCla" "GBD"
     [11] "GDP_MD_EST" "GEO3" "GEO3major" "GEOUNIT" "GEOU_DIF"
     [16] "GLOCAF" "GU_A3" "IMAGE24" "ISO3" "ISO3.1"
     [21] "ISO_A2" "ISO_A3" "ISO_N3" "LAT" "LDC"
     [26] "LEVEL" "LLDC" "LON" "LabelRank" "MAP_COLOR"
     [31] "NAME" "NAME_FORMA" "NAME_SORT" "POP_EST" "POSTAL"
     [36] "REGION" "SID" "SOVEREIGNT" "SOV_A3" "SRES"
     [41] "SRESmajor" "SUBUNIT" "SU_A3" "SU_DIF" "ScaleRank"
     [46] "Stern" "TERR_" "TYPE" "continent"
     Enter an ISO3 code: Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
     Enter the turbine number that you want to optimize.Please enter the corresponding number:
    
     Hit <ENTER> if this is your Polygon
     No Projection is given. Take Lambert Azimuthal Equal Area Projection.
    
     Hit <ENTER> if this is your Polygon
    
     Select appropriate Method. Either 'EQU' for equal crossover parts or 'RAN' for random parts.
     Type 'R' for random and 'E' for equal parts.
    
     Select appropriate Method. Either 'EQU' for equal crossover parts or 'RAN' for random parts.
     Type 'R' for random and 'E' for equal parts.
    
     Select appropriate Selection Method. Either 'FIX' or 'VAR' are available.
     Type 'F' for a fixed percentage of 50% and 'V' for a variable percentage.
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs.################### GA WARNING MESSAGE ###################
     Hit <ENTER> if this is your Polygon
     No Projection is given. Take Lambert Azimuthal Equal Area Projection.
    
     Hit <ENTER> if this is your Polygon
    
     Select appropriate Method. Either 'EQU' for equal crossover parts or 'RAN' for random parts.
     Type 'R' for random and 'E' for equal parts.
    
     Select appropriate Method. Either 'EQU' for equal crossover parts or 'RAN' for random parts.
     Type 'R' for random and 'E' for equal parts.
    
     Select appropriate Selection Method. Either 'FIX' or 'VAR' are available.
     Type 'F' for a fixed percentage of 50% and 'V' for a variable percentage.
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs....trying URL 'https://biogeo.ucdavis.edu/data/diva/msk_alt/AUT_msk_alt.zip'
     Content type 'application/zip' length 216165 bytes (211 KB)
     ==================================================
     downloaded 211 KB
    
    
     Hit <ENTER> if this is your Polygon
     No Projection is given. Take Lambert Azimuthal Equal Area Projection.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs......OGR data source with driver: ESRI Shapefile
     Source: "D:\temp\Rtmp0Eeljr\RLIBS_15a202de336c7\windfarmGA\extdata\shape.shp", layer: "shape"
     with 1 features
     It has 1 fields
    
     Hit <ENTER> if this is your Polygon
     No Projection is given. Take Lambert Azimuthal Equal Area Projection.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs....
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs......
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs......
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
     ################### GA WARNING MESSAGE ###################
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
     ################### GA WARNING MESSAGE ###################
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs.weibullsrc class:
     1 - data.frame
     Hit <ENTER> if this is your Polygon
     Polygon is not projected. Lambert Azimuthal Equal Area Projection is used.
    
     Hit <ENTER> if this is your Polygon
    
     Press <ENTER> if the windrose looks correct?
    
     Is the grid spacing appropriate?Type 'ENTER' if the the grid is corrent and 'n' if you like to change some inputs.list item classes:
     1 - numeric
     2 - numeric== testthat results ===========================================================
     [ OK: 769 | SKIPPED: 1 | WARNINGS: 149 | FAILED: 1 ]
     1. Error: Test Terrain and Weibull Effects (@test_terrain.R#39)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-oldrel-windows-ix86+x86_64