Running ‘testthat.R’ [101s/96s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(handwriterRF)
  > 
  > test_check("handwriterRF")
  Copying samples to project directory > docs...
  
  Estimating writer profiles...
  Listing documents to be processed...
  Creating output directory...
  Directory already exists.
  Processing document w0030_s01_pWOZ_r01.png...
  path in readPNGBinary: /var/folders/k4/0jwzxmln0nb8y6rkzprptb640000gq/T//RtmpiscnBo/comparison/docs/w0030_s01_pWOZ_r01.png
  Starting Processing...
  Getting Nodes...
  Skeletonizing writing...
  Splitting document into components...
  Merging nodes...
  Finding paths...
  Split paths into graphs...
  Organizing graphs...
  Creating graph lists...
  Adding character features...
  Document processing complete
  Saving processed document w0030_s01_pWOZ_r01.png...
  
  Processing document w0030_s01_pWOZ_r02.png...
  path in readPNGBinary: /var/folders/k4/0jwzxmln0nb8y6rkzprptb640000gq/T//RtmpiscnBo/comparison/docs/w0030_s01_pWOZ_r02.png
  Starting Processing...
  Getting Nodes...
  Skeletonizing writing...
  Splitting document into components...
  Merging nodes...
  Finding paths...
  Split paths into graphs...
  Organizing graphs...
  Creating graph lists...
  Adding character features...
  Document processing complete
  Saving processed document w0030_s01_pWOZ_r02.png...
  
  All documents were successfully processed...
  
  Loading graphs for w0030_s01_pWOZ_r01_proclist.rds
  Getting cluster assignments for w0030_s01_pWOZ_r01
  Saving cluster assignments for  w0030_s01_pWOZ_r01 
  
  Loading graphs for w0030_s01_pWOZ_r02_proclist.rds
  Getting cluster assignments for w0030_s01_pWOZ_r02
  Saving cluster assignments for  w0030_s01_pWOZ_r02 
  
  Calculating distance between samples...
  Calculating similarity score...
  Calculating distance between samples...
  Calculating similarity score...
  Calculating distance between samples...
  Calculating similarity score...
  Calculating distance between samples...
  Calculating similarity score...
  Calculating SLR...
  Calculating distance between samples...
  Calculating similarity score...
  Calculating SLR...
  Copying samples to project directory > docs...
  
  Estimating writer profiles...
  Listing documents to be processed...
  Creating output directory...
  Directory already exists.
  Processing document w0030_s01_pWOZ_r01.png...
  path in readPNGBinary: /var/folders/k4/0jwzxmln0nb8y6rkzprptb640000gq/T//RtmpiscnBo/comparison/docs/w0030_s01_pWOZ_r01.png
  Starting Processing...
  Getting Nodes...
  Skeletonizing writing...
  Splitting document into components...
  Merging nodes...
  Finding paths...
  Split paths into graphs...
  Organizing graphs...
  Creating graph lists...
  Adding character features...
  Document processing complete
  Saving processed document w0030_s01_pWOZ_r01.png...
  
  Processing document w0030_s01_pWOZ_r02.png...
  path in readPNGBinary: /var/folders/k4/0jwzxmln0nb8y6rkzprptb640000gq/T//RtmpiscnBo/comparison/docs/w0030_s01_pWOZ_r02.png
  Starting Processing...
  Getting Nodes...
  Skeletonizing writing...
  Splitting document into components...
  Merging nodes...
  Finding paths...
  Split paths into graphs...
  Organizing graphs...
  Creating graph lists...
  Adding character features...
  Document processing complete
  Saving processed document w0030_s01_pWOZ_r02.png...
  
  All documents were successfully processed...
  
  Loading graphs for w0030_s01_pWOZ_r01_proclist.rds
  Getting cluster assignments for w0030_s01_pWOZ_r01
  Saving cluster assignments for  w0030_s01_pWOZ_r01 
  
  Loading graphs for w0030_s01_pWOZ_r02_proclist.rds
  Getting cluster assignments for w0030_s01_pWOZ_r02
  Saving cluster assignments for  w0030_s01_pWOZ_r02 
  
  Calculating distance between samples...
  Calculating similarity score...
  Calculating SLR...
  Copying samples to project directory > docs...
  
  Estimating writer profiles...
  Listing documents to be processed...
  Creating output directory...
  Directory already exists.
  Processing document w0030_s01_pWOZ_r01.png...
  path in readPNGBinary: /var/folders/k4/0jwzxmln0nb8y6rkzprptb640000gq/T//RtmpiscnBo/comparison/docs/w0030_s01_pWOZ_r01.png
  Starting Processing...
  Getting Nodes...
  Skeletonizing writing...
  Splitting document into components...
  Merging nodes...
  Finding paths...
  Split paths into graphs...
  Organizing graphs...
  Creating graph lists...
  Adding character features...
  Document processing complete
  Saving processed document w0030_s01_pWOZ_r01.png...
  
  Processing document w0238_s01_pWOZ_r02.png...
  path in readPNGBinary: /var/folders/k4/0jwzxmln0nb8y6rkzprptb640000gq/T//RtmpiscnBo/comparison/docs/w0238_s01_pWOZ_r02.png
  Starting Processing...
  Getting Nodes...
  Skeletonizing writing...
  Splitting document into components...
  Merging nodes...
  Finding paths...
  Split paths into graphs...
  Organizing graphs...
  Creating graph lists...
  Adding character features...
  Document processing complete
  Saving processed document w0238_s01_pWOZ_r02.png...
  
  All documents were successfully processed...
  
  Loading graphs for w0030_s01_pWOZ_r01_proclist.rds
  Getting cluster assignments for w0030_s01_pWOZ_r01
  Saving cluster assignments for  w0030_s01_pWOZ_r01 
  
  Loading graphs for w0238_s01_pWOZ_r02_proclist.rds
  Getting cluster assignments for w0238_s01_pWOZ_r02
  Saving cluster assignments for  w0238_s01_pWOZ_r02 
  
  Calculating distance between samples...
  Calculating similarity score...
  Calculating SLR...
  Copying samples to project directory > docs...
  
  Estimating writer profiles...
  Listing documents to be processed...
  Creating output directory...
  Directory already exists.
  All documents have been processed or flagged as problem files.
  Loading graphs for w0030_s01_pWOZ_r01_proclist.rds
       Cluster assignments already exist for w0030_s01_pWOZ_r01 
  
  Loading graphs for w0030_s01_pWOZ_r02_proclist.rds
       Cluster assignments already exist for w0030_s01_pWOZ_r02 
  
  Calculating distance between samples...
  Calculating similarity score...
  Calculating SLR...
  Samples have the same file name so they will be renamed 'sample1.png' and 'sample2.png'.
  Copying samples to project directory > docs...
  
  Estimating writer profiles...
  Listing documents to be processed...
  Creating output directory...
  Directory already exists.
  Processing document sample1.png...
  path in readPNGBinary: /var/folders/k4/0jwzxmln0nb8y6rkzprptb640000gq/T//RtmpiscnBo/comparison/docs/sample1.png
  Starting Processing...
  Getting Nodes...
  Skeletonizing writing...
  Splitting document into components...
  Merging nodes...
  Finding paths...
  Split paths into graphs...
  Organizing graphs...
  Creating graph lists...
  Adding character features...
  Document processing complete
  Saving processed document sample1.png...
  
  Processing document sample2.png...
  path in readPNGBinary: /var/folders/k4/0jwzxmln0nb8y6rkzprptb640000gq/T//RtmpiscnBo/comparison/docs/sample2.png
  Starting Processing...
  Getting Nodes...
  Skeletonizing writing...
  Splitting document into components...
  Merging nodes...
  Finding paths...
  Split paths into graphs...
  Organizing graphs...
  Creating graph lists...
  Adding character features...
  Document processing complete
  Saving processed document sample2.png...
  
  All documents were successfully processed...
  
  Loading graphs for sample1_proclist.rds
  Getting cluster assignments for sample1
  Saving cluster assignments for  sample1 
  
  Loading graphs for sample2_proclist.rds
  Getting cluster assignments for sample2
  Saving cluster assignments for  sample2 
  
  Calculating distance between samples...
  Calculating similarity score...
  Calculating SLR...
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 41 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-compare.R:49:3'): Compare writer profiles works on unknown writers when score_only is FALSE ──
  `actual` (`actual`) not equal to `expected` (`expected`).
  
  actual vs expected
                         slr
  - actual[1, ]   254.889367
  + expected[1, ] 254.896611
  - actual[2, ]   108.363010
  + expected[2, ] 108.363186
  - actual[3, ]    43.335689
  + expected[3, ]  43.336182
  - actual[4, ]     1.270565
  + expected[4, ]   1.270562
  - actual[5, ]    11.530177
  + expected[5, ]  11.530097
  - actual[6, ]    17.914962
  + expected[6, ]  17.915382
  
      actual$slr  | expected$slr    
  [1] 254.8893665 - 254.8966114  [1]
  [2] 108.3630096 - 108.3631863  [2]
  [3] 43.3356887  - 43.3361817   [3]
  [4] 1.2705652   - 1.2705621    [4]
  [5] 11.5301773  - 11.5300965   [5]
  [6] 17.9149619  - 17.9153823   [6]
  ── Failure ('test-compare.R:61:3'): Compare writer profiles works on known writers when score_only is FALSE ──
  `actual` (`actual`) not equal to `expected` (`expected`).
  
  actual vs expected
                         slr
  - actual[1, ]   254.889367
  + expected[1, ] 254.896611
  - actual[2, ]   108.363010
  + expected[2, ] 108.363186
  - actual[3, ]    43.335689
  + expected[3, ]  43.336182
  - actual[4, ]     1.270565
  + expected[4, ]   1.270562
  - actual[5, ]    11.530177
  + expected[5, ]  11.530097
  - actual[6, ]    17.914962
  + expected[6, ]  17.915382
  
      actual$slr  | expected$slr    
  [1] 254.8893665 - 254.8966114  [1]
  [2] 108.3630096 - 108.3631863  [2]
  [3] 43.3356887  - 43.3361817   [3]
  [4] 1.2705652   - 1.2705621    [4]
  [5] 11.5301773  - 11.5300965   [5]
  [6] 17.9149619  - 17.9153823   [6]
  ── Failure ('test-slrs.R:16:3'): Calculate SLR works on w0030 samples ──────────
  `actual` (`actual`) not equal to `expected` (`expected`).
  
  actual vs expected
                       slr
  - actual[1, ]   20.00722
  + expected[1, ] 20.00790
  
    `actual$slr`: 20.00722
  `expected$slr`: 20.00790
  ── Failure ('test-slrs.R:34:3'): Calculate SLR works on w0030 versus w0238 samples ──
  `actual` (`actual`) not equal to `expected` (`expected`).
  
  actual vs expected
                        slr
  - actual[1, ]   0.5060655
  + expected[1, ] 0.5060652
  
    `actual$slr`: 0.50606550
  `expected$slr`: 0.50606524
  ── Failure ('test-slrs.R:49:3'): Calculate SLR works on w0030 samples in project directory ──
  `actual` (`actual`) not equal to `expected` (`expected`).
  
  actual vs expected
                       slr
  - actual[1, ]   20.00722
  + expected[1, ] 20.00790
  
    `actual$slr`: 20.00722
  `expected$slr`: 20.00790
  ── Failure ('test-slrs.R:86:3'): Calculate SLRs works if samples in different folders have the same file name ──
  `actual` (`actual`) not equal to `expected` (`expected`).
  
  actual vs expected
                       slr
  - actual[1, ]   30.88832
  + expected[1, ] 30.88831
  
    `actual$slr`: 30.888321
  `expected$slr`: 30.888307
  ── Failure ('test-slrs.R:151:3'): Make densities works with ranger package ─────
  `actual` (`actual`) not equal to `expected` (`expected`).
  
  `actual$same_writer` is length 7
  `expected$same_writer` is length 8
  
      names(actual$same_writer) | names(expected$same_writer)    
  [2] "y"                       | "y"                         [2]
  [3] "bw"                      | "bw"                        [3]
  [4] "n"                       | "n"                         [4]
  [5] "call"                    - "old.coords"                [5]
  [6] "data.name"               - "call"                      [6]
  [7] "has.na"                  - "data.name"                 [7]
                                - "has.na"                    [8]
  
       actual$same_writer$y | expected$same_writer$y                  
   [1] 0.00033467           - 0.00033457             [1]              
   [2] 0.00034180           - 0.00034170             [2]              
   [3] 0.00034907           - 0.00034896             [3]              
   [4] 0.00035647           - 0.00035637             [4]              
   [5] 0.00036403           - 0.00036392             [5]              
   [6] 0.00037171           - 0.00037160             [6]              
   [7] 0.00037956           - 0.00037944             [7]              
   [8] 0.00038754           - 0.00038742             [8]              
   [9] 0.00039569           - 0.00039557             [9]              
  [10] 0.00040397           - 0.00040385             [10]             
   ... ...                    ...                    and 9990 more ...
  
  `actual$same_writer$old.coords` is absent
  `expected$same_writer$old.coords` is a logical vector (FALSE)
  
  `actual$diff_writer` is length 7
  `expected$diff_writer` is length 8
  
      names(actual$diff_writer) | names(expected$diff_writer)    
  [2] "y"                       | "y"                         [2]
  [3] "bw"                      | "bw"                        [3]
  [4] "n"                       | "n"                         [4]
  [5] "call"                    - "old.coords"                [5]
  [6] "data.name"               - "call"                      [6]
  [7] "has.na"                  - "data.name"                 [7]
                                - "has.na"                    [8]
  
       actual$diff_writer$y | expected$diff_writer$y                  
   [1] 0.004284978          - 0.004283563            [1]              
   [2] 0.004397465          - 0.004396019            [2]              
   [3] 0.004512772          - 0.004511295            [3]              
   [4] 0.004630740          - 0.004629231            [4]              
   [5] 0.004751621          - 0.004750078            [5]              
   [6] 0.004875308          - 0.004873732            [6]              
   [7] 0.005002002          - 0.005000392            [7]              
   [8] 0.005131654          - 0.005130009            [8]              
   [9] 0.005264410          - 0.005262730            [9]              
  [10] 0.005400283          - 0.005398567            [10]             
   ... ...                    ...                    and 9990 more ...
  
  `actual$diff_writer$old.coords` is absent
  `expected$diff_writer$old.coords` is a logical vector (FALSE)
  
  [ FAIL 7 | WARN 0 | SKIP 0 | PASS 41 ]
  Error: Test failures
  Execution halted