* using log directory ‘/data/blackswan/ripley/R/packages/tests-devel/MRG.Rcheck’ * using R Under development (unstable) (2025-12-20 r89211) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) GNU Fortran (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) * running under: Fedora Linux 40 (Workstation Edition) * using session charset: UTF-8 * checking for file ‘MRG/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘MRG’ version ‘0.3.21’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘MRG’ can be installed ... [23s/24s] OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [33s/34s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... [12s/13s] OK * checking examples with --run-donttest ... [16m/16m] ERROR Running examples in ‘MRG-Ex.R’ failed The error most likely occurred in: > ### Name: multiResGrid > ### Title: Create multi-resolution grids based on confidentiality or > ### reliability restrictions > ### Aliases: multiResGrid multiResGrid.MRG multiResGrid.sf > ### multiResGrid.list > > ### ** Examples > > ## No test: > library(sf) Linking to GEOS 3.12.2, GDAL 3.8.5, PROJ 9.3.1; sf_use_s2() is TRUE > if (!require(ggplot2)) print("Plotting of results will not work + without installation of ggplot2") Loading required package: ggplot2 > if (!require(viridis)) print("Some of the plots will not work + without installation of viridis package") Loading required package: viridis Loading required package: viridisLite > if (!require(patchwork)) print("Some of the plots will not work + without installation of patchwork") Loading required package: patchwork > > if (require(giscoR)) { + useBorder = TRUE + } else { + useBorder = FALSE + print("You need to install giscoR for plotting borders and clipping the gridded maps") + } Loading required package: giscoR > # These are SYNTHETIC agricultural FSS data > data(ifs_dk) # Census data > ifs_weight = ifs_dk %>% dplyr::filter(Sample == 1) # Extract weighted subsample > > # Create spatial data > ifg = fssgeo(ifs_dk, locAdj = "LL") > fsg = fssgeo(ifs_weight, locAdj = "LL") > > if (useBorder) { + # Read country borders, only used for plotting + borders = gisco_get_nuts(nuts_level = 0) + dkb = borders[borders$CNTR_CODE == "DK",] %>% st_transform(crs = 3035) + } > > ress = c(1,5,10,20,40, 80, 160)*1000 > # Gridding Utilized agricultural area (UAA) > ifl = gridData(ifg, "UAA",res = ress) > # Gridding organic utilized agricultural area > ifl2 = gridData(ifg, vars = "UAAXK0000_ORG", res = ress) > > # Gridding UAA and organic UAA together > ifl3 = gridData(ifg, vars = c("UAA", "UAAXK0000_ORG"), res = ress) > > # Gridding the UAA from the survey - the survey weights are in the column EXT_MODULE > fsl = gridData(fsg, vars = c("UAA"), weights = "EXT_MODULE", res = ress) > > # Create a multi-resolution grid only with farm number as confidentiality rule, then plot results > himg0 = multiResGrid(ifl, checkReliability = FALSE, suppresslim = 0) [1] "ires 2 5000 #himg-cells: 2179 ; removed: 23704 ; added: 2107 ; confidential: 72" [1] "ires 3 10000 #himg-cells: 1642 ; removed: 768 ; added: 231 ; confidential: 41" [1] "ires 4 20000 #himg-cells: 1539 ; removed: 137 ; added: 34 ; confidential: 9" [1] "ires 5 40000 #himg-cells: 1451 ; removed: 96 ; added: 8 ; confidential: 1" [1] "ires 6 80000 #himg-cells: 1366 ; removed: 86 ; added: 1 ; confidential: 0" [1] "ires 7 160000 #himg-cells: 1366 ; removed: 0 ; added: 0 ; confidential: 0" > ggplot(himg0) + geom_sf(aes(fill = count)) > > # Create a multi-resolution grid of UAA, also based on the dominance rule (default) > himg1 = multiResGrid(ifl, vars = "UAA", ifg = ifg) [1] "ires 2 5000 #himg-cells: 2179 ; removed: 23704 ; added: 2107 ; confidential: 72" [1] "ires 3 10000 #himg-cells: 1601 ; removed: 824 ; added: 246 ; confidential: 42" [1] "ires 4 20000 #himg-cells: 1493 ; removed: 145 ; added: 37 ; confidential: 9" [1] "ires 5 40000 #himg-cells: 1405 ; removed: 96 ; added: 8 ; confidential: 1" [1] "ires 6 80000 #himg-cells: 1333 ; removed: 73 ; added: 1 ; confidential: 0" [1] "ires 7 160000 #himg-cells: 1333 ; removed: 0 ; added: 0 ; confidential: 0" > p1 = ggplot(himg1) + geom_sf(aes(fill = UAA)) > p1 > > # Create a multi-resolution grid of UAA, also based on the p-percent rule > himg101 = multiResGrid(ifl, vars = "UAA", ifg = ifg, checkPpercent = TRUE) [1] "ires 2 5000 #himg-cells: 2179 ; removed: 23704 ; added: 2107 ; confidential: 72" [1] "ires 3 10000 #himg-cells: 1601 ; removed: 824 ; added: 246 ; confidential: 42" [1] "ires 4 20000 #himg-cells: 1492 ; removed: 147 ; added: 38 ; confidential: 9" [1] "ires 5 40000 #himg-cells: 1404 ; removed: 96 ; added: 8 ; confidential: 1" [1] "ires 6 80000 #himg-cells: 1332 ; removed: 73 ; added: 1 ; confidential: 0" [1] "ires 7 160000 #himg-cells: 1332 ; removed: 0 ; added: 0 ; confidential: 0" > p11 = ggplot(himg101) + geom_sf(aes(fill = UAA)) > p11 > > # Create multi-resolution grid of organic UAA > himg2 = multiResGrid(ifl2, vars = "UAAXK0000_ORG", ifg = ifg) [1] "ires 2 5000 #himg-cells: 5513 ; removed: 19922 ; added: 1659 ; confidential: 7" [1] "ires 3 10000 #himg-cells: 894 ; removed: 5180 ; added: 561 ; confidential: 23" [1] "ires 4 20000 #himg-cells: 229 ; removed: 832 ; added: 167 ; confidential: 13" [1] "ires 5 40000 #himg-cells: 148 ; removed: 110 ; added: 29 ; confidential: 4" [1] "ires 6 80000 #himg-cells: 125 ; removed: 29 ; added: 6 ; confidential: 3" [1] "ires 7 160000 #himg-cells: 114 ; removed: 13 ; added: 2 ; confidential: 2" > himg21 = multiResGrid(ifl2, vars = "UAAXK0000_ORG", ifg = ifg, postProcess = FALSE) [1] "ires 2 5000 #himg-cells: 5513 ; removed: 19922 ; added: 1659 ; confidential: 7" [1] "ires 3 10000 #himg-cells: 894 ; removed: 5180 ; added: 561 ; confidential: 23" [1] "ires 4 20000 #himg-cells: 229 ; removed: 832 ; added: 167 ; confidential: 13" [1] "ires 5 40000 #himg-cells: 148 ; removed: 110 ; added: 29 ; confidential: 4" [1] "ires 6 80000 #himg-cells: 125 ; removed: 29 ; added: 6 ; confidential: 3" [1] "ires 7 160000 #himg-cells: 114 ; removed: 13 ; added: 2 ; confidential: 2" > > ggplot(himg2) + geom_sf(aes(fill = UAAXK0000_ORG)) > > # Create joint multi-resolution grid of organic UAA and total UAA > himg3 = multiResGrid(ifl3, vars = c("UAA", "UAAXK0000_ORG"), ifg = ifg, + checkReliability = FALSE, suppresslim = 0) [1] "ires 2 5000 #himg-cells: 2179 ; removed: 23704 ; added: 2107 ; confidential: 72" [1] "ires 3 10000 #himg-cells: 636 ; removed: 2126 ; added: 583 ; confidential: 48" [1] "ires 4 20000 #himg-cells: 192 ; removed: 613 ; added: 169 ; confidential: 17" [1] "ires 5 40000 #himg-cells: 121 ; removed: 103 ; added: 32 ; confidential: 5" [1] "ires 6 80000 #himg-cells: 103 ; removed: 25 ; added: 7 ; confidential: 3" [1] "ires 7 160000 #himg-cells: 94 ; removed: 11 ; added: 2 ; confidential: 2" > # Create multi-resolution grid of organic UAA, based on the UAA grid > # The large number of missing values indicates that this feature should > # mainly be used for data that have similar or higher resolution as the > # original data set. > himg33 = multiResGrid(himg1, vars = c("UAAXK0000_ORG"), ifg = ifg, + checkReliability = FALSE, suppresslim = 0) MRGinp is not an sf-object > p31 = ggplot(himg3) + geom_sf(aes(fill = UAA)) > p32 = ggplot(himg3) + geom_sf(aes(fill = UAAXK0000_ORG)) > p33 = ggplot(himg33) + geom_sf(aes(fill = UAAXK0000_ORG)) > if (require(patchwork)) p31 + p32 + p33 > > # Create multi-resolution grid of UAA, based on survey data, > # with and without applying reliability check > # This is a relatively slow functionality > # rounding is set to FALSE, to be better able to visualize the few records > # (Not recommended for data to be published) > himg4 = multiResGrid(fsl, vars = c("UAA"), weights = "EXT_MODULE", ifg = fsg, + strat = "STRA_ID_CORE", checkReliability = FALSE, rounding = FALSE) [1] "ires 2 5000 #himg-cells: 2034 ; removed: 8185 ; added: 1738 ; confidential: 272" [1] "ires 3 10000 #himg-cells: 1190 ; removed: 1180 ; added: 336 ; confidential: 36" [1] "ires 4 20000 #himg-cells: 1069 ; removed: 157 ; added: 36 ; confidential: 5" [1] "ires 5 40000 #himg-cells: 1032 ; removed: 43 ; added: 6 ; confidential: 0" [1] "ires 6 80000 #himg-cells: 1032 ; removed: 0 ; added: 0 ; confidential: 0" [1] "ires 7 160000 #himg-cells: 1032 ; removed: 0 ; added: 0 ; confidential: 0" > # The parameter reliabilitySplit = 15 will divide the data set in 15 groups for the > # reliabilityCheck. > # A lower value would be recommended, but a high value speeds up the computation for this example > himg5 = multiResGrid(fsl, vars = c("UAA"), weights = "EXT_MODULE", ifg = fsg, + strat = "STRA_ID_CORE", checkReliability = TRUE, + reliabilitySplit = TRUE, rounding = FALSE, pseudoreg = "REGIONS") Error in `[.data.table`(var_z_hi, , `:=`((paste0("var_", namY)), lapply(.SD[, : attempt access index 972/972 in VECTOR_ELT Calls: multiResGrid ... mrg_varestim -> vardom -> variance_est -> [ -> [.data.table Execution halted * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘multiResGrid.R’ [28s/28s] [28s/29s] ERROR Running the tests in ‘tests/multiResGrid.R’ failed. Complete output: > s1 = Sys.time() > library(MRG) > library(tidyr) > library(dplyr) Attaching package: 'dplyr' The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union > # Neccessary to silence sf startup messages > suppressMessages(library(sf)) > if (require(giscoR, quietly = TRUE)) { + # Read nuts borders, used for extracting smaller data set + borders = gisco_get_nuts(nuts_level = 2) + dkb = borders[borders$CNTR_CODE == "DK",] %>% st_transform(crs = 3035) + } else { + mrgpath = find.package("MRG") + load(file.path(mrgpath, "ex/dkb.rda")) + } > #' > # These are SYNTHETIC agricultural FSS data > data(ifs_dk) # Census data > ifs_weight = ifs_dk %>% dplyr::filter(Sample == 1) # Extract weighted subsample > > # Create spatial data > ifg = fssgeo(ifs_dk, locAdj = "LL") > fsg = fssgeo(ifs_weight, locAdj = "LL") > > ifg$dkb = st_join(ifg, dkb)$NUTS_ID > ifg = ifg[!is.na(ifg$dkb) & ifg$dkb == "DK01",] > fsg$dkb = st_join(fsg, dkb)$NUTS_ID > fsg = fsg[!is.na(fsg$dkb) & fsg$dkb == "DK01",] > > ifg$ft = as.numeric(substr(ifg$FARMTYPE, 3, 4))^2 > > s2 = Sys.time() > #' > # Set the base resolutions, and create a hierarchical list with gridded data > ress = c(1,5,10,20,40)*1000 > # Gridding Utilized agricultural area (UAA), organic UAA and ft together > ifl = gridData(ifg, c("UAA", "UAAXK0000_ORG", "ft"), res = ress) > > # Gridding the UAA from the survey - the survey weights are in the column EXT_MODULE > fsl = gridData(fsg, vars = c("UAA"), weights = "EXT_MODULE", res = ress) > > # Create a multi-resolution grid only with farm number as confidentiality rule, then plot results > himg0 = multiResGrid(ifl, checkReliability = FALSE, suppresslim = 0) [1] "ires 2 5000 #himg-cells: 117 ; removed: 1209 ; added: 108 ; confidential: 9" [1] "ires 3 10000 #himg-cells: 79 ; removed: 58 ; added: 20 ; confidential: 5" [1] "ires 4 20000 #himg-cells: 68 ; removed: 14 ; added: 3 ; confidential: 2" [1] "ires 5 40000 #himg-cells: 56 ; removed: 13 ; added: 1 ; confidential: 1" > > # Create a multi-resolution grid of UAA, also based on the dominance rule (default) > himg1 = multiResGrid(ifl, vars = "UAA", ifg = ifg) [1] "ires 2 5000 #himg-cells: 117 ; removed: 1209 ; added: 108 ; confidential: 9" [1] "ires 3 10000 #himg-cells: 79 ; removed: 58 ; added: 20 ; confidential: 5" [1] "ires 4 20000 #himg-cells: 67 ; removed: 16 ; added: 4 ; confidential: 2" [1] "ires 5 40000 #himg-cells: 48 ; removed: 21 ; added: 2 ; confidential: 1" > > # Create joint multi-resolution grid of organic UAA > himg2 = multiResGrid(ifl, vars = "UAAXK0000_ORG", ifg = ifg, + checkReliability = FALSE, suppresslim = 0) [1] "ires 2 5000 #himg-cells: 298 ; removed: 1002 ; added: 82 ; confidential: 0" [1] "ires 3 10000 #himg-cells: 67 ; removed: 263 ; added: 32 ; confidential: 3" [1] "ires 4 20000 #himg-cells: 29 ; removed: 50 ; added: 12 ; confidential: 3" [1] "ires 5 40000 #himg-cells: 20 ; removed: 14 ; added: 5 ; confidential: 2" > > # Create joint multi-resolution grid of organic UAA and total UAA > himg3 = multiResGrid(ifl, vars = c("UAA", "UAAXK0000_ORG"), ifg = ifg, + checkReliability = FALSE, suppresslim = 0) [1] "ires 2 5000 #himg-cells: 117 ; removed: 1209 ; added: 108 ; confidential: 9" [1] "ires 3 10000 #himg-cells: 41 ; removed: 109 ; added: 33 ; confidential: 6" [1] "ires 4 20000 #himg-cells: 18 ; removed: 35 ; added: 12 ; confidential: 5" [1] "ires 5 40000 #himg-cells: 9 ; removed: 14 ; added: 5 ; confidential: 3" > > > # Create joint multi-resolution grid of organic UAA and total UAA, with suppression > himg4 = multiResGrid(ifl, vars = c("UAA", "UAAXK0000_ORG"), ifg = ifg, + checkReliability = FALSE, suppresslim = 0.1) [1] "ires 2 5000 #himg-cells: 117 ; removed: 1209 ; added: 108 ; confidential: 9" [1] "ires 3 10000 #himg-cells: 41 ; removed: 109 ; added: 33 ; confidential: 6" [1] "ires 4 20000 #himg-cells: 18 ; removed: 35 ; added: 12 ; confidential: 5" [1] "ires 5 40000 #himg-cells: 16 ; removed: 4 ; added: 2 ; confidential: 7" > > # Create joint multi-resolution grid of ft > himg5 = multiResGrid(ifl, vars = c("ft"), ifg = ifg, + checkReliability = FALSE, suppresslim = 0.1) [1] "ires 2 5000 #himg-cells: 117 ; removed: 1209 ; added: 108 ; confidential: 9" [1] "ires 3 10000 #himg-cells: 90 ; removed: 43 ; added: 16 ; confidential: 9" [1] "ires 4 20000 #himg-cells: 85 ; removed: 7 ; added: 2 ; confidential: 6" > > himg6 = multiResGrid(ifl, vars = c("UAA", "UAAXK0000_ORG", "ft"), ifg = ifg, + checkReliability = FALSE, suppresslim = 0.1) [1] "ires 2 5000 #himg-cells: 117 ; removed: 1209 ; added: 108 ; confidential: 9" [1] "ires 3 10000 #himg-cells: 41 ; removed: 109 ; added: 33 ; confidential: 6" [1] "ires 4 20000 #himg-cells: 18 ; removed: 35 ; added: 12 ; confidential: 5" [1] "ires 5 40000 #himg-cells: 16 ; removed: 4 ; added: 2 ; confidential: 7" > > himg7 = MRGmerge(himg1, himg2, himg3 = himg5) Warning messages: 1: attribute variables are assumed to be spatially constant throughout all geometries 2: attribute variables are assumed to be spatially constant throughout all geometries > > s3 = Sys.time() > > > # Create multi-resolution grid of UAA and organic UAA, based on survey data, > # also applying reliability check > himg5 <- multiResGrid(fsl, vars = c("UAA"), weights = "EXT_MODULE", ifg = fsg, + strat = "STRA_ID_CORE", checkReliability = TRUE, reliabilitySplit = 5) Error in `[.data.table`(var_z_hi, , `:=`((paste0("var_", namY)), lapply(.SD[, : attempt access index 220/220 in VECTOR_ELT Calls: multiResGrid ... mrg_varestim -> vardom -> variance_est -> [ -> [.data.table Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... OK * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * checking for new files in some other directories ... OK * DONE Status: 2 ERRORs See ‘/data/blackswan/ripley/R/packages/tests-devel/MRG.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 20:14.29, 1153.51 + 30.26