Running 'testthat.R' [47s/52s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > ops <- options("crayon.enabled" = FALSE)
  > library(testthat)
  > require("covr")
  Loading required package: covr
  > 
  > test_check("FRK")
  Loading required package: FRK
  Binned data in 0.076 seconds
  Binned data in 0.005 seconds
  Binned data in 0.015 seconds
  Normalising basis function evaluations at BAU level ...
  Binning data ...
  Binned data in 0.035 seconds
  
    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |=======================                                               |  33%
    |                                                                            
    |===============================================                       |  67%
    |                                                                            
    |======================================================================| 100%
  Maximum EM iterations reached
  Intercept 
  0.1777952 
  Formula: z ~ 1 
  Number of datasets: 1 
  Number of basis functions: 18 
  Class of basis functions: Basis 
  Number of BAUs [extract using object@BAUs]:  138 
  Number of observations [extract using object@Z]:  50 
  Mean obs. variance at BAU level [extract using object@Ve]: 0.01 
  Fine-scale variance proportionality constant [extract using object@sigma2fshat]: 0.08477454 
  Dimensions of C in Z = C*Y + e [extract using object@Cmat]:  c(50L, 138L) 
  Dimensions of S in Y = X*alpha + S*eta + delta [extract using object@S]:  c(50L, 18L) 
  Number of covariates: 1 
  
  Formula: z ~ 1 
  Number of datasets: 1 
  Number of basis functions: 18 
  Class of basis functions: Basis 
  Number of BAUs [extract using object@BAUs]:  138 
  Number of observations [extract using object@Z]:  50 
  Mean obs. variance at BAU level [extract using object@Ve]: 0.01 
  Fine-scale variance proportionality constant [extract using object@sigma2fshat]: 0.08477454 
  Dimensions of C in Z = C*Y + e [extract using object@Cmat]:  c(50L, 138L) 
  Dimensions of S in Y = X*alpha + S*eta + delta [extract using object@S]:  c(50L, 18L) 
  Number of covariates: 1 
  
  Normalising basis function evaluations at BAU level ...
  Binning data ...
  Binned data in 0.017 seconds
  
    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |=======================                                               |  33%
    |                                                                            
    |===============================================                       |  67%
    |                                                                            
    |======================================================================| 100%
  Maximum EM iterations reached
  Input geom 0 is INVALID: Self-intersection at or near point 34.084719804325559 -68.186470263844967 (34.084719804325558812 -68.186470263844967121)
  <A>
  POLYGON ((64.8482549999999947 -71.9435849999999988, 55.1439799999999991 -71.4564079999999962, 46.1059359999999998 -70.5004969999999958, 38.0071760000000012 -69.1342439999999954, 30.9342509999999997 -67.4252299999999991, 21.2063220000000001 -68.2650950000000023, 11.2500000000000000 -68.5626209999999929, 1.2936770000000000 -68.2650950000000023, 351.5657479999999850 -67.4252299999999991, 344.4928229999999871 -69.1342439999999954, 336.3940620000000195 -70.5004969999999958, 327.3560190000000034 -71.4564079999999962, 317.6517440000000079 -71.9435849999999988, 314.5931870000000004 -75.0822569999999985, 308.7343999999999937 -78.0859059999999943, 298.6585360000000264 -80.8106159999999960, 281.2499980000000050 -82.9884509999999977, 281.2499950000000126 -86.4860199999999963, 320.1237780000000157 -89.9999990000000025, 101.2499949999999984 -86.4860209999999938, 101.2499980000000050 -82.9884519999999952, 83.8414599999999979 -80.8106159999999960, 73.7655969999999996 -78.0859059999999943, 67.9068110000000047 -75.0822569999999985, 64.8482549999999947 -71.9435849999999988))
  </A>
  Normalising basis function evaluations at BAU level ...
  Binning data ...
  Normalising basis function evaluations at BAU level ...
  Binning data ...
  [1] "Entering test_basis.R"
  Number of basis functions: 50 
  Number of resolutions: 1 
  Type of manifold: surface of sphere 
  Dimension of manifold: 2 
  First basis function:
   function (s)  {     stopifnot(ncol(s) == dimensions(manifold))     dist_sq <- distance(manifold, s, mu)^2     exp(-0.5 * dist_sq/(std^2)) } 
  Number of basis functions: 50 
  Number of resolutions: 1 
  Type of manifold: surface of sphere 
  Dimension of manifold: 2 
  First basis function:
   function (s)  {     stopifnot(ncol(s) == dimensions(manifold))     dist_sq <- distance(manifold, s, mu)^2     exp(-0.5 * dist_sq/(std^2)) } 
  First set of basis functions
  ----------------------------
  Number of basis functions: 10 
  Number of resolutions: 1 
  Type of manifold: surface of sphere 
  Dimension of manifold: 2 
  First basis function:
   function (s)  {     stopifnot(ncol(s) == dimensions(manifold))     y <- distance(manifold, s, c)     (1 - (y/R)^2)^2 * (y < R) } 
  
  
  Second set of basis functions
  -----------------------------
  Number of basis functions: 3 
  Number of resolutions: 1 
  Type of manifold: real_line 
  Dimension of manifold: 1 
  First basis function:
   function (s)  {     stopifnot(ncol(s) == dimensions(manifold))     y <- distance(manifold, s, c)     (1 - (y/R)^2)^2 * (y < R) } 
  
  
  Total number of basis functions: 30First set of basis functions
  ----------------------------
  Number of basis functions: 10 
  Number of resolutions: 1 
  Type of manifold: surface of sphere 
  Dimension of manifold: 2 
  First basis function:
   function (s)  {     stopifnot(ncol(s) == dimensions(manifold))     y <- distance(manifold, s, c)     (1 - (y/R)^2)^2 * (y < R) } 
  
  
  Second set of basis functions
  -----------------------------
  Number of basis functions: 3 
  Number of resolutions: 1 
  Type of manifold: real_line 
  Dimension of manifold: 1 
  First basis function:
   function (s)  {     stopifnot(ncol(s) == dimensions(manifold))     y <- distance(manifold, s, c)     (1 - (y/R)^2)^2 * (y < R) } 
  
  
  Total number of basis functions: 30[1] "Entering test_domains.R"
  Type of manifold: surface of sphere 
  Radius of sphere: 6371 
  Dimension of manifold: 2 
  Distance function:
   function (x1, x2 = NULL)  dist_sphere(x1, x2, R = R) 
  Type of manifold: surface of sphere 
  Radius of sphere: 6371 
  Dimension of manifold: 2 
  Distance function:
   function (x1, x2 = NULL)  dist_sphere(x1, x2, R = R) 
  Type of manifold: plane 
  Dimension of manifold: 2 
  Distance function:
   function (x1, x2)  distR(x1, x2) 
  Type of manifold: plane 
  Dimension of manifold: 2 
  Distance function:
   function (x1, x2)  distR(x1, x2) 
  Type of manifold: real_line 
  Dimension of manifold: 1 
  Distance function:
   function (x1, x2)  distR(x1, x2) 
  Type of manifold: real_line 
  Dimension of manifold: 1 
  Distance function:
   function (x1, x2)  distR(x1, x2) 
  Type of manifold: STplane 
  Dimension of manifold: 3 
  Distance function:
   function (x1, x2)  distR(x1, x2) 
  Type of manifold: STplane 
  Dimension of manifold: 3 
  Distance function:
   function (x1, x2)  distR(x1, x2) 
  Type of manifold: STplane 
  Dimension of manifold: 3 
  Distance function:
   function (x1, x2)  distR(x1, x2) 
  Type of manifold: STplane 
  Dimension of manifold: 3 
  Distance function:
   function (x1, x2)  distR(x1, x2) 
  ... Fitting variogram for estimating measurement error
  sigma2e estimate =  0.03310956 
  Constructing BAUs...
  Generating basis functions...
  ...Automatically choosing number of functions...
  Modelling using 819 basis functions
  Constructing SRE model...
  Normalising basis function evaluations at BAU level ...
  ... Fitting variogram for estimating measurement error
  sigma2e estimate =  0.2518847 
  Binning data ...
  Binned data in 0.31 seconds
  Fitting SRE model...
  
    |                                                                            
    |                                                                      |   0%
    |                                                                            
    |===================================                                   |  50%
    |                                                                            
    |======================================================================| 100%
  Maximum EM iterations reached
  == Warnings ====================================================================
  -- Warning (test_BAUs.R:35:5): plane_BAUs --------------------------------------
  there is no package called 'INLA'
  Backtrace:
   1. base::require("INLA") test_BAUs.R:35:4
   6. base::library(...)
  -- Warning (test_BAUs.R:141:5): SpaceTime_BAUs ---------------------------------
  there is no package called 'INLA'
  Backtrace:
   1. base::require("INLA") test_BAUs.R:141:4
   6. base::library(...)
  -- Warning (test_SRE.R:133:5): SRE sphere works --------------------------------
  Self-intersection at or near point 34.084719804325559 -68.186470263844967
  Backtrace:
    1. FRK::auto_BAUs(...) test_SRE.R:133:4
    3. FRK:::auto_BAU(...)
    4. FRK:::process_isea3h(isea3h, resl)
    9. rgeos::gIntersection(prob_polys2_sp[i, ], line)
   11. rgeos::gIsValid(spgeom1, byid = TRUE)
   12. rgeos:::RGEOSUnaryPredFunc(spgeom, byid, "rgeos_isvalid")
  -- Warning (test_SRE.R:133:5): SRE sphere works --------------------------------
  Invalid objects found; consider using set_RGEOS_CheckValidity(2L)
  Backtrace:
   1. FRK::auto_BAUs(...) test_SRE.R:133:4
   3. FRK:::auto_BAU(...)
   4. FRK:::process_isea3h(isea3h, resl)
   9. rgeos::gIntersection(prob_polys2_sp[i, ], line)
  
  == Failed tests ================================================================
  -- Error (test_BAUs.R:167:5): SpaceTime_BAUs -----------------------------------
  Error: replacement has length zero
  Backtrace:
       x
    1. +-FRK:::map_data_to_BAUs(STobj1, space_time_grid, average_in_BAU = TRUE) test_BAUs.R:167:4
    2. \-FRK:::map_data_to_BAUs(STobj1, space_time_grid, average_in_BAU = TRUE)
    3.   \-FRK:::.local(data_sp, sp_pols, average_in_BAU)
    4.     \-base::lapply(...)
    5.       \-FRK:::FUN(X[[i]], ...)
    6.         +-FRK:::map_data_to_BAUs(data_spatial, BAU_spatial, average_in_BAU = average_in_BAU)
    7.         \-FRK:::map_data_to_BAUs(data_spatial, BAU_spatial, average_in_BAU = average_in_BAU)
    8.           \-FRK:::.local(data_sp, sp_pols, average_in_BAU)
    9.             +-base::system.time(...)
   10.             \-FRK:::.parallel_over(data_sp, sp_pols)
   11.               +-sp::over(sp1, sp2, fn = fn)
   12.               \-sp::over(sp1, sp2, fn = fn)
   13.                 \-sp:::.local(x, y, returnList, fn, ...)
   14.                   +-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   15.                   \-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   16.                     \-sp:::pointsInSpatialPolygons(x, y, returnList)
   17.                       \-sp:::pointsInPolys2(...)
  -- Error (test_SRE.R:148:5): SRE sphere works ----------------------------------
  Error: more elements supplied than there are to replace
  Backtrace:
       x
    1. \-FRK::SRE(f, list(sim_data), G, grid_BAUs, est_error = FALSE) test_SRE.R:148:4
    2.   +-FRK:::map_data_to_BAUs(data[[i]], BAUs, average_in_BAU = average_in_BAU)
    3.   \-FRK:::map_data_to_BAUs(data[[i]], BAUs, average_in_BAU = average_in_BAU)
    4.     \-FRK:::.local(data_sp, sp_pols, average_in_BAU)
    5.       +-base::system.time(...)
    6.       \-FRK:::.parallel_over(data_sp, sp_pols)
    7.         +-sp::over(sp1, sp2, fn = fn)
    8.         \-sp::over(sp1, sp2, fn = fn)
    9.           \-sp:::.local(x, y, returnList, fn, ...)
   10.             +-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   11.             \-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   12.               \-sp:::pointsInSpatialPolygons(x, y, returnList)
   13.                 \-sp:::pointsInPolys2(...)
  -- Error (test_SRE.R:206:5): SRE space-time sphere works -----------------------
  Error: replacement has length zero
  Backtrace:
       x
    1. \-FRK::SRE(f, list(STobj), G, grid_BAUs, est_error = FALSE) test_SRE.R:206:4
    2.   +-FRK:::map_data_to_BAUs(data[[i]], BAUs, average_in_BAU = average_in_BAU)
    3.   \-FRK:::map_data_to_BAUs(data[[i]], BAUs, average_in_BAU = average_in_BAU)
    4.     \-FRK:::.local(data_sp, sp_pols, average_in_BAU)
    5.       \-base::lapply(...)
    6.         \-FRK:::FUN(X[[i]], ...)
    7.           +-FRK:::map_data_to_BAUs(data_spatial, BAU_spatial, average_in_BAU = average_in_BAU)
    8.           \-FRK:::map_data_to_BAUs(data_spatial, BAU_spatial, average_in_BAU = average_in_BAU)
    9.             \-FRK:::.local(data_sp, sp_pols, average_in_BAU)
   10.               +-base::system.time(...)
   11.               \-FRK:::.parallel_over(data_sp, sp_pols)
   12.                 +-sp::over(sp1, sp2, fn = fn)
   13.                 \-sp::over(sp1, sp2, fn = fn)
   14.                   \-sp:::.local(x, y, returnList, fn, ...)
   15.                     +-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   16.                     \-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   17.                       \-sp:::pointsInSpatialPolygons(x, y, returnList)
   18.                         \-sp:::pointsInPolys2(...)
  -- Error (test_basis.R:78:5): can average basis over polygons in plane ---------
  Error: more elements supplied than there are to replace
  Backtrace:
       x
    1. +-sp::SpatialPolygonsDataFrame(...) test_basis.R:78:4
    2. | \-base::nrow(data)
    3. +-base::cbind(over(HexPols, meuse.grid), coordinates(HexPts))
    4. +-sp::over(HexPols, meuse.grid)
    5. \-sp::over(HexPols, meuse.grid)
    6.   \-sp:::.local(x, y, returnList, fn, ...)
    7.     +-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
    8.     \-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
    9.       \-sp:::pointsInSpatialPolygons(geometry(y), geometry(x), TRUE)
   10.         \-sp:::pointsInPolys2(...)
  -- Error (test_sre_polygon_predict.R:15:5): can predict over polygons in plane --
  Error: more elements supplied than there are to replace
  Backtrace:
      x
   1. +-sp::SpatialPolygonsDataFrame(HexPols, over(HexPols, meuse.grid)) test_sre_polygon_predict.R:15:4
   2. | \-base::nrow(data)
   3. +-sp::over(HexPols, meuse.grid)
   4. \-sp::over(HexPols, meuse.grid)
   5.   \-sp:::.local(x, y, returnList, fn, ...)
   6.     +-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   7.     \-sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   8.       \-sp:::pointsInSpatialPolygons(geometry(y), geometry(x), TRUE)
   9.         \-sp:::pointsInPolys2(...)
  -- Error (test_support.R:12:1): (code run outside of `test_that()`) ------------
  Error: more elements supplied than there are to replace
  Backtrace:
      x
   1. \-FRK::auto_BAUs(...) test_support.R:12:0
   2.   +-FRK:::auto_BAU(...)
   3.   \-FRK:::auto_BAU(...)
   4.     +-sp::over(d, xy)
   5.     \-sp::over(d, xy)
   6.       \-sp:::pointsInSpatialPolygons(geometry(y), geometry(x), TRUE)
   7.         \-sp:::pointsInPolys2(...)
  
  [ FAIL 6 | WARN 4 | SKIP 0 | PASS 175 ]
  Error: Test failures
  Execution halted