Running ‘testthat.R’ [20s/40s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(windfarmGA)
  > library(rgdal)
  Loading required package: sp
  rgdal: version: 1.5-23, (SVN revision 1121)
  Geospatial Data Abstraction Library extensions to R successfully loaded
  Loaded GDAL runtime: GDAL 2.2.4, released 2018/03/19
  Path to GDAL shared files: /usr/local/share/gdal
  GDAL binary built with GEOS: TRUE 
  Loaded PROJ runtime: Rel. 5.2.0, September 15th, 2018, [PJ_VERSION: 520]
  Path to PROJ shared files: (autodetected)
  Linking to sp version:1.4-5
  > library(rgeos)
  rgeos version: 0.5-5, (SVN revision 640)
   GEOS runtime version: 3.6.4-CAPI-1.10.4 
   Linking to sp version: 1.4-5 
   Polygon checking: TRUE 
  
  > 
  > test_check("windfarmGA")
   [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: 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
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (4)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test_ga_func.R:46:3): Test Genetic Algorithm Function ────────────────
  Error: incorrect number of dimensions
  Backtrace:
      █
   1. └─windfarmGA::grid_area(shape = Polygon1, size = 200, prop = 1) test_ga_func.R:46:2
   2.   ├─grid_intersect[indx, ]
   3.   ├─sf:::`[.sfc`(grid_intersect, indx, )
   4.   │ └─sf::st_sfc(...)
   5.   └─base::NextMethod()
  ── Error (test_parallel.R:19:3): Test Parallelisation ──────────────────────────
  Error: incorrect number of dimensions
  Backtrace:
      █
   1. └─windfarmGA::genetic_algorithm(...) test_parallel.R:19:2
   2.   └─windfarmGA::grid_area(Polygon1, resol2, Proportionality)
   3.     ├─grid_intersect[indx, ]
   4.     ├─sf:::`[.sfc`(grid_intersect, indx, )
   5.     │ └─sf::st_sfc(...)
   6.     └─base::NextMethod()
  ── Error (test_random_search.R:14:3): Test Random Search Functions ─────────────
  Error: incorrect number of dimensions
  Backtrace:
      █
   1. └─windfarmGA::random_search(...) test_random_search.R:14:2
   2.   └─windfarmGA::grid_area(shape = Polygon1, size = resolu, prop = propu)
   3.     ├─grid_intersect[indx, ]
   4.     ├─sf:::`[.sfc`(grid_intersect, indx, )
   5.     │ └─sf::st_sfc(...)
   6.     └─base::NextMethod()
  ── Error (test_user_input.R:22:3): User Input ──────────────────────────────────
  Error: Evaluation error: Found 5 features with invalid spherical geometry.
  [12] Loop 0 is not valid: Edge 743 crosses edge 998
  [20] Loop 0 is not valid: Edge 130 crosses edge 132
  [39] Loop 0 is not valid: Edge 3145 has duplicate vertex with edge 3148
  [100] Loop 0 is not valid: Edge 1356 has duplicate vertex with edge 1359
  [123] Loop 0 is not valid: Edge 139 has duplicate vertex with edge 142.
  Backtrace:
       █
    1. └─windfarmGA::getISO3(pp = points, crs_pp = 3035, col = "?") test_user_input.R:22:2
    2.   ├─base::suppressWarnings(st_intersection(pp, st_as_sf(countriesSP)))
    3.   │ └─base::withCallingHandlers(...)
    4.   ├─sf::st_intersection(pp, st_as_sf(countriesSP))
    5.   └─sf:::st_intersection.sf(pp, st_as_sf(countriesSP))
    6.     ├─sf:::geos_op2_df(x, y, geos_op2_geom("intersection", x, y))
    7.     └─sf:::geos_op2_geom("intersection", x, y)
    8.       ├─base::structure(...)
    9.       ├─base::unlist(...)
   10.       └─base::lapply(x, fn, y, s2::s2_options(model = s2_model, ...))
   11.         └─s2:::FUN(X[[i]], ...)
   12.           ├─s2:::recycle_common(as_s2_geography(x), as_s2_geography(y))
   13.           ├─s2::as_s2_geography(y)
   14.           └─sf:::as_s2_geography.sfc(y)
   15.             └─sf:::st_as_s2.sfc(x, ..., oriented = oriented)
   16.               ├─s2::as_s2_geography(st_as_binary(x), ..., oriented = oriented)
   17.               └─s2:::as_s2_geography.WKB(st_as_binary(x), ..., oriented = oriented)
   18.                 ├─s2:::new_s2_xptr(...)
   19.                 └─s2:::s2_geography_from_wkb(x, oriented = oriented, check = check)
  ── Error (test_visibility.R:36:3): Test Viewshed Functions ─────────────────────
  Error: Evaluation error: Found 5 features with invalid spherical geometry.
  [12] Loop 0 is not valid: Edge 743 crosses edge 998
  [20] Loop 0 is not valid: Edge 130 crosses edge 132
  [39] Loop 0 is not valid: Edge 3145 has duplicate vertex with edge 3148
  [100] Loop 0 is not valid: Edge 1356 has duplicate vertex with edge 1359
  [123] Loop 0 is not valid: Edge 139 has duplicate vertex with edge 142.
  Backtrace:
       █
    1. └─windfarmGA::getISO3(pp = points, crs_pp = 3035) test_visibility.R:36:2
    2.   ├─base::suppressWarnings(st_intersection(pp, st_as_sf(countriesSP)))
    3.   │ └─base::withCallingHandlers(...)
    4.   ├─sf::st_intersection(pp, st_as_sf(countriesSP))
    5.   └─sf:::st_intersection.sf(pp, st_as_sf(countriesSP))
    6.     ├─sf:::geos_op2_df(x, y, geos_op2_geom("intersection", x, y))
    7.     └─sf:::geos_op2_geom("intersection", x, y)
    8.       ├─base::structure(...)
    9.       ├─base::unlist(...)
   10.       └─base::lapply(x, fn, y, s2::s2_options(model = s2_model, ...))
   11.         └─s2:::FUN(X[[i]], ...)
   12.           ├─s2:::recycle_common(as_s2_geography(x), as_s2_geography(y))
   13.           ├─s2::as_s2_geography(y)
   14.           └─sf:::as_s2_geography.sfc(y)
   15.             └─sf:::st_as_s2.sfc(x, ..., oriented = oriented)
   16.               ├─s2::as_s2_geography(st_as_binary(x), ..., oriented = oriented)
   17.               └─s2:::as_s2_geography.WKB(st_as_binary(x), ..., oriented = oriented)
   18.                 ├─s2:::new_s2_xptr(...)
   19.                 └─s2:::s2_geography_from_wkb(x, oriented = oriented, check = check)
  ── Error (test_wake.R:113:3): Test Wake Functions ──────────────────────────────
  Error: incorrect number of dimensions
  Backtrace:
      █
   1. └─windfarmGA::grid_area(...) test_wake.R:113:2
   2.   ├─grid_intersect[indx, ]
   3.   ├─sf:::`[.sfc`(grid_intersect, indx, )
   4.   │ └─sf::st_sfc(...)
   5.   └─base::NextMethod()
  
  [ FAIL 6 | WARN 0 | SKIP 4 | PASS 130 ]
  Error: Test failures
  Execution halted