Running 'run_testthat.R' [7s]
  Running 'test_defineMUM.R' [170s]
  Running 'test_genSample_jointSPDF.R' [185s]
  Running 'test_genSample_marginalRaster.R' [9s]
  Running 'test_genSample_marginalSPDF.R' [8s]
  Running 'test_makeCRM.R' [163s]
  Running 'test_propagate_raster.R' [168s]
  Running 'test_render.R' [170s]
Running the tests in 'tests/test_defineMUM.R' failed.
Complete output:
  > # test -- defineMUM()
  > 
  > library(spup)
  > library(gstat)
  > library(sp)
  > 
  > # test with data from gstat
  > data(meuse)
  > # make spatial
  > coordinates(meuse) = ~x+y
  > # make separate spatial grid data frames for mean and sd
  > m1 <- meuse["zinc"]
  > m1.sd <- m1
  > m1.sd[[1]] <- m1.sd[[1]] * rnorm(n = 155, mean = 1, sd = 0.5)
  > m2 <- meuse["lead"]
  > m2.sd <- m2
  > m2.sd[[1]] <- m2.sd[[1]] * rnorm(n = 155, mean = 1, sd = 0.5)
  > # define srm and UM and sample
  > crm1 <- makeCRM(acf0 = 0.6, range = 100, model = "Sph")
  > crm2 <- makeCRM(acf0 = 0.7, range = 100, model = "Exp")
  > UM1 <- defineUM(uncertain = TRUE, distribution = "norm",
  +                 distr_param = c(m1, m1.sd), crm = crm1)
  > UM2 <- defineUM(uncertain = TRUE, distribution = "norm",
  +                 distr_param = c(m2, m2.sd), crm = crm2)
  > cormat <- matrix(c(1,0.7,0.7,1), nrow = 2, ncol = 2)
  > JointUM <- defineMUM(list(UM1,UM2), cormatrix = cormat)								
  > class(JointUM)
  [1] "JointNumericSpatial"
  > 
  > proc.time()
     user  system elapsed 
     6.25    0.42    6.65 
Running the tests in 'tests/test_genSample_jointSPDF.R' failed.
Complete output:
  > # test -- defineMUM()
  > 
  > library(spup)
  > library(gstat)
  > library(sp)
  > 
  > # test with data from gstat
  > data(meuse)
  > # make spatial
  > coordinates(meuse) = ~x+y
  > # make separate spatial grid data frames for mean and sd
  > m1 <- meuse["zinc"]
  > m1.sd <- m1
  > m1.sd[[1]] <- m1.sd[[1]] * rnorm(n = 155, mean = 1, sd = 0.5)
  > m2 <- meuse["lead"]
  > m2.sd <- m2
  > m2.sd[[1]] <- m2.sd[[1]] * rnorm(n = 155, mean = 1, sd = 0.5)
  > # define srm and UM and sample
  > crm1 <- makeCRM(acf0 = 0.6, range = 200, model = "Exp")
  > crm2 <- makeCRM(acf0 = 0.7, range = 200, model = "Exp")
  > UM1 <- defineUM(uncertain = TRUE, distribution = "norm",
  +                 distr_param = c(m1, m1.sd), crm = crm1, id = "zinc")
  > UM2 <- defineUM(uncertain = TRUE, distribution = "norm",
  +                 distr_param = c(m2, m2.sd), crm = crm2, id = "lead")
  > cormat <- matrix(c(1,0.7,0.7,1), nrow = 2, ncol = 2)
  > JointUM <- defineMUM(list(UM1,UM2), cormatrix = cormat)	
  > a <- genSample(UMobject = JointUM, n = 4, "ugs", asList = FALSE)							
  Linear Model of Coregionalization found. Good.
  [using unconditional Gaussian cosimulation]
  > spplot(a)
  > 
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     8.26    0.59    8.84 
Running the tests in 'tests/test_makeCRM.R' failed.
Complete output:
  > # test -- makecrm()
  > library(spup)
  > 
  > data(dem30m)
  > crm1 <- makeCRM(acf0 = 0.8, range = 300, model = "Exp")
  > crm2 <- makeCRM(acf0 = 0.2, range = 700, model = "Sph") 
  > crm3 <- makeCRM(acf0 = 0.8, range = 700, model = "Lin") 
  > crm4 <- makeCRM(acf0 = 0.8, range = 200, model = "Gau") 
  > 
  > par(mfrow = c(2, 2))
  > plot(crm1, main = "'Spherical', acf0 = 0.8, range = 700")
  > plot(crm2, main = "'Spherical', acf0 = 0.2, range = 700")
  > plot(crm3, main = "'Linear', acf0 = 1.0, range = 700")
  > plot(crm4, main = "'Gaussian', acf0 = 0.8, range = 200")
  > 
  > proc.time()
     user  system elapsed 
     6.23    0.39    6.60 
Running the tests in 'tests/test_propagate_raster.R' failed.
Complete output:
  > # test -- propagate()
  > 
  > library(spup)
  > library(raster)
  Loading required package: sp
  > 
  > # create dummy rasters
  > set.seed(654321)
  > # create var1
  > sdf <- data.frame(x = rep(0:2, each = 3),
  +                   y = rep(0:2, 3),
  +                   l = rnorm(9))
  > coordinates(sdf) <- ~ x + y
  > gridded(sdf) <- TRUE
  > rasterDF1 <- raster(sdf)
  > 
  > sdf <- data.frame(x = rep(0:2, each = 3),
  +                   y = rep(0:2, 3),
  +                   l = runif(9))
  > coordinates(sdf) <- ~ x + y
  > gridded(sdf) <- TRUE
  > rasterDFsd1 <- raster(sdf)
  > 
  > # create var2
  > sdf <- data.frame(x = rep(0:2, each = 3),
  +                   y = rep(0:2, 3),
  +                   l = rnorm(9,100,1))
  > coordinates(sdf) <- ~ x + y
  > gridded(sdf) <- TRUE
  > rasterDF2 <- raster(sdf)
  > # sd for the second var
  > sdf <- data.frame(x = rep(0:2, each = 3),
  +                   y = rep(0:2, 3),
  +                   l = rnorm(9,10,0.5))
  > coordinates(sdf) <- ~ x + y
  > gridded(sdf) <- TRUE
  > rasterDFsd2 <- raster(sdf)
  > 
  > # define UM and run sampling
  > crm1 <- makeCRM(0.8, 200, "Sph")
  > UM1 <- defineUM(TRUE, distribution = "norm", crm = crm1,
  +                 distr_param = c(rasterDF1, rasterDFsd2))
  > UM2 <- defineUM(TRUE, "norm", c(rasterDF2, rasterDFsd2)) 
  > var1 <- genSample(UM1, 10, "ugs")
  [using unconditional Gaussian simulation]
  > var2 <- genSample(UM2, 10, "randomSampling")
  There were 20 warnings (use warnings() to see them)
  > 
  > # run propagation
  > some_model <- function(A, B) {
  +   C <- A*B
  +   C
  + }
  > out <- propagate(list(var1, var2), some_model, 10)
  > summary(out)
        Length Class       Mode
   [1,] 9      RasterLayer S4  
   [2,] 9      RasterLayer S4  
   [3,] 9      RasterLayer S4  
   [4,] 9      RasterLayer S4  
   [5,] 9      RasterLayer S4  
   [6,] 9      RasterLayer S4  
   [7,] 9      RasterLayer S4  
   [8,] 9      RasterLayer S4  
   [9,] 9      RasterLayer S4  
  [10,] 9      RasterLayer S4  
  > 
  > some_model <- function(A) A*2
  > out <- propagate(var1, some_model, 10)
  > summary(out)
        Length Class       Mode
   [1,] 9      RasterLayer S4  
   [2,] 9      RasterLayer S4  
   [3,] 9      RasterLayer S4  
   [4,] 9      RasterLayer S4  
   [5,] 9      RasterLayer S4  
   [6,] 9      RasterLayer S4  
   [7,] 9      RasterLayer S4  
   [8,] 9      RasterLayer S4  
   [9,] 9      RasterLayer S4  
  [10,] 9      RasterLayer S4  
  > 
  > 
  > 
  > 
  > proc.time()
     user  system elapsed 
     7.87    0.54    8.42 
Running the tests in 'tests/test_render.R' failed.
Complete output:
  > # test -- render()
  > 
  > library(spup)
  > library(magrittr)
  > library(whisker)
  > 
  > # render table
  > my_template <- c(
  +      "| x | y |",
  +      "|---|---|",
  +      "{{#MY_TABLE}}",
  +      "| {{X}} | {{Y}} |",
  +      "{{/MY_TABLE}}")
  > my_table <- data.frame(X = 1:5, Y = letters[1:5])
  > my_table
    X Y
  1 1 a
  2 2 b
  3 3 c
  4 4 d
  5 5 e
  > my_template %>%
  +   render(MY_TABLE = unname(rowSplit(my_table))) %>%
  + cat
  | x | y |
  |---|---|
  | 1 | a |
  | 2 | b |
  | 3 | c |
  | 4 | d |
  | 5 | e |
  > 
  > proc.time()
     user  system elapsed 
      6.1     0.4     6.5