R Under development (unstable) (2024-01-07 r85787 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # test -- genSample() > options(digits = 6) > > library(spup) > library(gstat) > library(sp) > > # test with data from gstat > data(meuse) > set.seed(12345) > # make spatial > coordinates(meuse) = ~x+y > # make separate spatial grid data frames for mean and sd > m <- meuse["zinc"] > m.sd <- m > m.sd[[1]] <- m.sd[[1]] * rnorm(n = 155, mean = 1, sd = 0.5) > # define srm and UM and sample > crm <- makeCRM(acf0 = 0.6, range = 40, model = "Sph") > UM <- defineUM(uncertain = TRUE, distribution = "norm", + distr_param = c(m, m.sd), crm = crm) > a <- genSample(UM, 10, samplemethod = "ugs") [using unconditional Gaussian simulation] > b <- genSample(UM, 10, samplemethod = "ugs", asList = FALSE) [using unconditional Gaussian simulation] > str(a) List of 10 $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim1: num [1:155] 321 -1550 1309 346 -162 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim2: num [1:155] -1114 682 -263 306 149 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim3: num [1:155] 1312 -918 467 734 280 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim4: num [1:155] 1469.9 2200.3 -77.5 73.4 -231.2 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim5: num [1:155] 1840 -1696 563 353 -91 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim6: num [1:155] 393.4 279.9 34.8 -40.2 81.3 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim7: num [1:155] 966 4006 1097 432 307 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim8: num [1:155] 1180 1697 202 216 902 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim9: num [1:155] 1190 921 670 465 252 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA $ :Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots .. ..@ data :'data.frame': 155 obs. of 1 variable: .. .. ..$ sim10: num [1:155] 2022 1273 1271 454 -279 ... .. ..@ coords.nrs : num(0) .. ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. .. ..$ : chr [1:2] "x" "y" .. ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. .. ..- attr(*, "dimnames")=List of 2 .. .. .. ..$ : chr [1:2] "x" "y" .. .. .. ..$ : chr [1:2] "min" "max" .. ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. .. ..@ projargs: chr NA > str(b) Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots ..@ data :'data.frame': 155 obs. of 10 variables: .. ..$ sim1 : num [1:155] 653 994 692 254 839 ... .. ..$ sim2 : num [1:155] 2306 -1194 713 301 703 ... .. ..$ sim3 : num [1:155] 2317.9 2278.8 1096.4 -43.7 421.4 ... .. ..$ sim4 : num [1:155] 2885 3259 739 168 257 ... .. ..$ sim5 : num [1:155] 2086 743 1307 468 279 ... .. ..$ sim6 : num [1:155] 967.6 2562.9 607.1 770.5 -12.1 ... .. ..$ sim7 : num [1:155] 4019 2865 196 -242 -539 ... .. ..$ sim8 : num [1:155] 299 -1627 -209 328 475 ... .. ..$ sim9 : num [1:155] 46.3 543.4 537.9 148.7 153.3 ... .. ..$ sim10: num [1:155] 865.7 -65.4 1463.8 496.1 1201.2 ... ..@ coords.nrs : int [1:2] 1 2 ..@ coords : num [1:155, 1:2] 181072 181025 181165 181298 181307 ... .. ..- attr(*, "dimnames")=List of 2 .. .. ..$ : chr [1:155] "1" "2" "3" "4" ... .. .. ..$ : chr [1:2] "x" "y" ..@ bbox : num [1:2, 1:2] 178605 329714 181390 333611 .. ..- attr(*, "dimnames")=List of 2 .. .. ..$ : chr [1:2] "x" "y" .. .. ..$ : chr [1:2] "min" "max" ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. ..@ projargs: chr NA > > proc.time() user system elapsed 8.43 0.50 8.90