* using log directory 'd:/Rcompile/CRANpkg/local/3.4/SmallCountRounding.Rcheck' * using R version 3.4.4 (2018-03-15) * using platform: x86_64-w64-mingw32 (64-bit) * using session charset: ISO8859-1 * checking for file 'SmallCountRounding/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'SmallCountRounding' version '0.3.0' * 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 hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'SmallCountRounding' can be installed ... OK * checking installed package size ... OK * checking package 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 R 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 use of S3 registration ... 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 ... [7s] OK * checking Rd files ... OK * checking Rd metadata ... 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 data for ASCII and uncompressed saves ... OK * checking examples ... ERROR Running examples in 'SmallCountRounding-Ex.R' failed The error most likely occurred in: > ### Name: PLSrounding > ### Title: PLS inspired rounding > ### Aliases: PLSrounding > > ### ** Examples > > # Small example data set > z <- SmallCountData("e6") > print(z) geo eu year freq 1 Iceland nonEU 2018 2 2 Portugal EU 2018 3 3 Spain EU 2018 7 4 Iceland nonEU 2019 1 5 Portugal EU 2019 5 6 Spain EU 2019 6 > > # Publishable cells by formula interface > a <- PLSrounding(z, "freq", roundBase = 5, formula = ~geo + eu + year) [{O...}-**.:=] > print(a) PLSrounding summary: maxdiff HDutility meanAbsDiff rootMeanSquare 3 0.938 1.25 1.6583 Frequencies of cell frequencies and absolute differences: inn.0 inn.1-4 inn.5 inn.6+ inn.all pub.0 pub.1-4 pub.5 pub.6+ pub.all original . 3 1 2 6 . 2 . 6 8 rounded 1 1 2 2 6 . . 2 6 8 absDiff 4 2 . . 6 3 5 . . 8 > print(a$inner) geo year original rounded difference 1 Iceland 2018 2 5 3 2 Portugal 2018 3 3 0 3 Spain 2018 7 7 0 4 Iceland 2019 1 0 -1 5 Portugal 2019 5 5 0 6 Spain 2019 6 6 0 > print(a$publish) geo year original rounded difference 1 Total Total 24 26 2 2 Iceland Total 3 5 2 3 Portugal Total 8 8 0 4 Spain Total 13 13 0 5 EU Total 21 21 0 6 nonEU Total 3 5 2 7 Total 2018 12 15 3 8 Total 2019 12 11 -1 > print(a$metrics) roundBase maxdiff inner_HDutility 5.0000000 3.0000000 0.8131709 HDutility inner_meanAbsDiff meanAbsDiff 0.9380433 0.6666667 1.2500000 inner_rootMeanSquare rootMeanSquare 1.2909944 1.6583124 > print(a$freqTable) inn.0 inn.1-4 inn.5 inn.6+ inn.all pub.0 pub.1-4 pub.5 pub.6+ pub.all original 0 3 1 2 6 0 2 0 6 8 rounded 1 1 2 2 6 0 0 2 6 8 absDiff 4 2 0 0 6 3 5 0 0 8 > > # Recalculation of maxdiff, HDutility, meanAbsDiff and rootMeanSquare > max(abs(a$publish[, "difference"])) [1] 3 > HDutility(a$publish[, "original"], a$publish[, "rounded"]) [1] 0.9380433 > mean(abs(a$publish[, "difference"])) [1] 1.25 > sqrt(mean((a$publish[, "difference"])^2)) [1] 1.658312 > > # Four lines below produce equivalent results > # Ordering of rows can be different > PLSrounding(z, "freq") [-**.:=] PLSrounding summary: maxdiff HDutility meanAbsDiff rootMeanSquare 1 0.9117 0.3333 0.5774 Frequencies of cell frequencies and absolute differences: inn.0 inn.1-2 inn.3 inn.4+ inn.all pub.0 pub.1-2 pub.3 pub.4+ pub.all original . 2 1 3 6 . 4 3 11 18 rounded 1 . 2 3 6 2 . 5 11 18 absDiff 4 2 . . 6 12 6 . . 18 > PLSrounding(z, "freq", formula = ~eu * year + geo * year) [{O.....}-**.:=] PLSrounding summary: maxdiff HDutility meanAbsDiff rootMeanSquare 1 0.9117 0.3333 0.5774 Frequencies of cell frequencies and absolute differences: inn.0 inn.1-2 inn.3 inn.4+ inn.all pub.0 pub.1-2 pub.3 pub.4+ pub.all original . 2 1 3 6 . 4 3 11 18 rounded 1 . 2 3 6 2 . 5 11 18 absDiff 4 2 . . 6 12 6 . . 18 > PLSrounding(z[, -2], "freq", hierarchies = SmallCountData("eHrc")) [-**.:=] PLSrounding summary: maxdiff HDutility meanAbsDiff rootMeanSquare 1 0.9117 0.3333 0.5774 Frequencies of cell frequencies and absolute differences: inn.0 inn.1-2 inn.3 inn.4+ inn.all pub.0 pub.1-2 pub.3 pub.4+ pub.all original . 2 1 3 6 . 4 3 11 18 rounded 1 . 2 3 6 2 . 5 11 18 absDiff 4 2 . . 6 12 6 . . 18 > PLSrounding(z[, -2], "freq", hierarchies = SmallCountData("eDimList")) [-**.:=] PLSrounding summary: maxdiff HDutility meanAbsDiff rootMeanSquare 1 0.9117 0.3333 0.5774 Frequencies of cell frequencies and absolute differences: inn.0 inn.1-2 inn.3 inn.4+ inn.all pub.0 pub.1-2 pub.3 pub.4+ pub.all original . 2 1 3 6 . 4 3 11 18 rounded 1 . 2 3 6 2 . 5 11 18 absDiff 4 2 . . 6 12 6 . . 18 > > # Define publishable cells differently by making use of formula interface > PLSrounding(z, "freq", formula = ~eu * year + geo) [{O....}-**.:=] PLSrounding summary: maxdiff HDutility meanAbsDiff rootMeanSquare 1 0.931 0.3333 0.5774 Frequencies of cell frequencies and absolute differences: inn.0 inn.1-2 inn.3 inn.4+ inn.all pub.0 pub.1-2 pub.3 pub.4+ pub.all original . 2 1 3 6 . 2 2 8 12 rounded 1 . 2 3 6 1 . 3 8 12 absDiff 4 2 . . 6 8 4 . . 12 > > # Define publishable cells differently by making use of hierarchy interface > eHrc2 <- list(geo = c("EU", "@Portugal", "@Spain", "Iceland"), year = c("2018", "2019")) > PLSrounding(z, "freq", hierarchies = eHrc2) [-**.:=] PLSrounding summary: maxdiff HDutility meanAbsDiff rootMeanSquare 1 0.9357 0.2667 0.5164 Frequencies of cell frequencies and absolute differences: inn.0 inn.1-2 inn.3 inn.4+ inn.all pub.0 pub.1-2 pub.3 pub.4+ pub.all original . 2 1 3 6 . 2 2 11 15 rounded 1 . 2 3 6 1 . 3 11 15 absDiff 4 2 . . 6 11 4 . . 15 > > # Package sdcHierarchies can be used to create hierarchies. > # The small example code below works if this package is available. > if (require(sdcHierarchies)) { + z2 <- cbind(geo = c("11", "21", "22"), z[, 3:4], stringsAsFactors = FALSE) + h2 <- list( + geo = hier_compute(inp = unique(z2$geo), dim_spec = c(1, 1), root = "Tot", as = "df"), + year = hier_convert(hier_create(root = "Total", nodes = c("2018", "2019")), as = "df")) + PLSrounding(z2, "freq", hierarchies = h2) + } Loading required package: sdcHierarchies Loading required package: shinythemes Package "sdcHierarchies" 0.18 has been loaded. Error in isFALSE(dt) : could not find function "isFALSE" Calls: hier_compute -> hier_convert -> .to_df Execution halted * checking PDF version of manual ... OK * DONE Status: 1 ERROR