* using log directory ‘/Users/ripley/R/packages/tests-devel/ElectionsLATAM.Rcheck’ * using R Under development (unstable) (2022-04-27 r82265) * using platform: aarch64-apple-darwin21.4.0 (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘ElectionsLATAM/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘ElectionsLATAM’ version ‘0.1.1’ * 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 ‘ElectionsLATAM’ can be installed ... OK * checking installed package size ... 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 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 ... 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 installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ ERROR Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(ElectionsLATAM) > library(lgr) > library(dplyr) Attaching package: 'dplyr' The following object is masked from 'package:testthat': matches The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union > library(readr) Attaching package: 'readr' The following objects are masked from 'package:testthat': edition_get, local_edition > > log.levels <- lgr::get_log_levels() > > lgr$set_threshold(log.levels["debug"]) > lgr::threshold("debug", lgr::get_logger("EcologicalInferenceStrategyCalvoEtAl")) > > > > test_check("ElectionsLATAM") INFO [19:04:58.186] Loading input election {input.filepath: `/Users/ripley/R/packages/tests-devel/ElectionsLATAM.Rcheck/ElectionsLATAM/extdata/costa-rica/2021-generales_pivot_candidatos_n4.csv`} INFO [19:04:58.271] Setting seed {seed: `143324`} INFO [19:04:58.298] Starting with {input.locations: `6661`, output.locations: `6738`, locations.available: `6661`} INFO [19:04:58.400] After filtering locations {input.locations: `6661`, output.locations: `6661`} INFO [19:04:58.416] After filtering comparable locations {threshold: `0.2`, non.comparable.locations: `252`, non.comparable.votes: `43224`, comparable.locations: `6409`, comparable.votes: `2040019`, input.locations: `6409`, output.locations: `6409`} DEBUG [19:04:58.489] newdata = dsINpre+dsOUTpre {nrow.dsINpre: `6409`, nrow.dsOUTpre: `6409`} INFO [19:04:58.490] ParamsEstim {nR: `10`, nC: `5`} INFO [19:05:01.541] calcFractions INFO [19:05:01.545] Results for {description: `input.original`, results: `FA= 3.24|Otros= 2.81|PLN= 10.15|PLP= 4.6|PNR= 5.56|PSD= 6.25|PUSC= 4.62|habilitados= 62.25|blanco_y_nulo= 0.52`, total.votes: `2083243`} INFO [19:05:01.549] Results for {description: `input`, results: `FA= 8.62|Otros= 7.36|PLN= 26.92|PLP= 12.32|PNR= 14.33|PSD= 16.67|PUSC= 12.08|blanco_y_nulo= 1.33|ausente= 0.36`, total.votes: `2040019`} INFO [19:05:01.550] Results for {description: `output.original`, results: `PLN= 16.63|PSD= 18.64|habilitados= 63.79|blanco_y_nulo= 0.93`, total.votes: `1978230`} INFO [19:05:01.551] Results for {description: `output`, results: `PLN= 43.56|PSD= 48.72|blanco_y_nulo= 2.43|ausente= 5.3`, total.votes: `1939026`} INFO [19:05:01.551] Votes {total.input.votes: `2083243`, total.input.applied.votes: `2040019`, total.output.votes: `1978230`, total.output.applied.votes: `1939026`, change.input.output.votes: `0.9496`, change.input.output.applied.votes: `0.9505`, dismissed.input.votes: `0.9793`, dismissed.output.votes: `0.9802`} INFO [19:05:01.555] Ecological inference Betab file writen {betab.filepath: `/var/folders/pk/n4bndnt1287ctrd_ftthnnnr0000gp/T//RtmpOuLCfG/working_dir/RtmpIoxqhF/test/costa-rica/2022-costa-rica-general-ballotage-n4-ein-betab-scen-final-s-143324.csv`} INFO [19:05:01.569] Ecological inference json writen {json.filepath: `/var/folders/pk/n4bndnt1287ctrd_ftthnnnr0000gp/T//RtmpOuLCfG/working_dir/RtmpIoxqhF/test/costa-rica/balotaje_n4_ei.json`} INFO [19:05:01.573] Generating sankeyNetwork {nodes: `13`, links: `36`} WARN [19:05:01.607] expectCompatible- diff in Output Matrix {i: `4`, j: `3`, row: `PLP`, col: `blanco_y_nulo`, observed: `6382`, expected: `4179`, diff.rel: `0.5272`} INFO [19:05:01.732] Loading input election {input.filepath: `/Users/ripley/R/packages/tests-devel/ElectionsLATAM.Rcheck/ElectionsLATAM/extdata/costa-rica/2021-generales_pivot_candidatos_n4.csv`} INFO [19:05:01.751] Setting seed {seed: `143324`} INFO [19:05:01.764] Starting with {input.locations: `6661`, output.locations: `6738`, locations.available: `6661`} INFO [19:05:01.818] After filtering locations {input.locations: `6661`, output.locations: `6661`} INFO [19:05:01.831] After filtering comparable locations {threshold: `0.3`, non.comparable.locations: `0`, non.comparable.votes: `0`, comparable.locations: `6661`, comparable.votes: `3435539`, input.locations: `6661`, output.locations: `6661`} DEBUG [19:05:01.876] newdata = dsINpre+dsOUTpre {nrow.dsINpre: `6661`, nrow.dsOUTpre: `6661`} INFO [19:05:01.876] ParamsEstim {nR: `10`, nC: `5`} INFO [19:05:05.104] calcFractions INFO [19:05:05.115] Results for {description: `input.original`, results: `FA= 8.58|Otros= 7.44|PLN= 26.9|PLP= 12.18|PNR= 14.72|PSD= 16.56|PUSC= 12.24|blanco_y_nulo= 1.38`, total.votes: `2083243`} INFO [19:05:05.116] Results for {description: `input`, results: `FA= 5.2|Otros= 4.51|PLN= 16.31|PLP= 7.39|PNR= 8.92|PSD= 10.04|PUSC= 7.42|blanco_y_nulo= 0.84|ausente= 39.36`, total.votes: `2083243`} INFO [19:05:05.117] Results for {description: `output.original`, results: `PLN= 45.94|PSD= 51.48|blanco_y_nulo= 2.58`, total.votes: `1978230`} INFO [19:05:05.118] Results for {description: `output`, results: `PLN= 26.36|PSD= 29.58|blanco_y_nulo= 1.48|ausente= 42.58`, total.votes: `1972818`} INFO [19:05:05.119] Votes {total.input.votes: `2083243`, total.input.applied.votes: `2083243`, total.output.votes: `1978230`, total.output.applied.votes: `1972818`, change.input.output.votes: `0.9496`, change.input.output.applied.votes: `0.947`, dismissed.input.votes: `1`, dismissed.output.votes: `0.9973`} [ FAIL 1 | WARN 0 | SKIP 0 | PASS 53 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Failure (test_costa_rica.R:45:3): Costa Rica ecological Inference ─────────── `test.passes` is not TRUE `actual`: FALSE `expected`: TRUE Backtrace: ▆ 1. └─costa.rica.ein$expectCompatible(output.table.expected, tolerance.rel = 0.32) at test_costa_rica.R:45:2 2. └─testthat::expect_true(test.passes) [ FAIL 1 | WARN 0 | SKIP 0 | PASS 53 ] Error: Test failures Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking re-building of vignette outputs ... OK * checking PDF version of manual ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR See ‘/Users/ripley/R/packages/tests-devel/ElectionsLATAM.Rcheck/00check.log’ for details. 47.50 real 37.13 user 6.79 sys