Skip to content

kantorovich

Kantorovich Distance Between Probability Measures

v3.2.0 · Apr 23, 2024 · GPL-3

Description

Computes the Kantorovich distance between two probability measures on a finite set. The Kantorovich distance is also known as the Monge-Kantorovich distance or the first Wasserstein distance.

Downloads

732

Last 30 days

4969th

2.2K

Last 90 days

8.7K

Last year

Trend: -9% (30d vs prior 30d)

CRAN Check Status

10 ERROR
2 NOTE
2 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang ERROR
r-devel-linux-x86_64-debian-gcc ERROR
r-devel-linux-x86_64-fedora-clang ERROR
r-devel-linux-x86_64-fedora-gcc ERROR
r-devel-macos-arm64 ERROR
r-devel-windows-x86_64 ERROR
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 ERROR
r-patched-linux-x86_64 ERROR
r-release-linux-x86_64 ERROR
r-release-macos-arm64 NOTE
r-release-macos-x86_64 NOTE
r-release-windows-x86_64 ERROR
Check details (53 non-OK)
NOTE r-devel-linux-x86_64-debian-clang

CRAN incoming feasibility

Maintainer: ‘Stéphane Laurent <laurent_step@outlook.fr>’

No Authors@R field in DESCRIPTION.
Please add one, modifying
  Authors@R: person(given = "Stéphane",
                    family = "Laurent",
                    role = c("aut", "cre"),
                    email = "laurent_step@outlook.fr")
as necessary.
NOTE r-devel-linux-x86_64-debian-clang

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-devel-linux-x86_64-debian-clang

examples

Running examples in ‘kantorovich-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
Backtrace:
     ▆
  1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
  2.   └─CVXR::psolve(problem, solver = solver, ...)
  3.     └─CVXR::solve_via_data(...)
  4.       ├─S7::S7_dispatch()
  5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
  6.         └─CVXR::solve_via_data(...)
  7.           ├─S7::S7_dispatch()
  8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
  9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
 10.               └─rlang::abort(...)
Execution halted
ERROR r-devel-linux-x86_64-debian-clang

re-building of vignette outputs

Error(s) in re-building vignettes:
  ...
--- re-building ‘kantorovich.Rmd’ using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
 2.   └─CVXR::psolve(problem, solver = solver, ...)
 3.     └─CVXR::solve_via_data(...)
 4.       ├─S7::S7_dispatch()
 5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
 6.         └─CVXR::solve_via_data(...)
 7.           ├─S7::S7_dispatch()
 8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
Package ECOSolveR is required but not installed.
--- failed re-building ‘kantorovich.Rmd’

SUMMARY: processing the following file failed:
  ‘kantorovich.Rmd’

Error: Vignette re-building failed.
Execution halted
ERROR r-devel-linux-x86_64-debian-clang

tests

Running ‘testthat.R’ [8s/10s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in ``method(solve_via_data, CVXR::ECOS_Solver)`(x = <object>, data = list(c = c(0, 1, 1, 1, 0, 1, 1, 1, 0), A = new("dgCMatrix", i = c(0L, 3L, 6L, 0L, 4L, 7L, 0L, 5L, 8L, 1L, 3L, 9L, 1L, 4L, 10L, 1L, 5L, 11L, 2L, 3L, 12L, 2L, 4L, 13L, 2L, 5L
...[truncated]...
857143, 0.285714285714286,  0.571428571428571, 0.333333333333333, 0.111111111111111, 0.555555555555556, 0, 0, 0, 0, 0, 0, 0, 0, 0), dims = <object>, bool_idx = integer(0), int_idx = integer(0)), warm_start = FALSE, verbose = FALSE, solver_opts = list(), ...)`: Package ECOSolveR is required but not installed.
  Backtrace:
       ▆
    1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
    2.   └─CVXR::psolve(problem, solver = solver, ...)
    3.     └─CVXR::solve_via_data(...)
    4.       ├─S7::S7_dispatch()
    5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
    6.         └─CVXR::solve_via_data(...)
    7.           ├─S7::S7_dispatch()
    8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
    9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
   10.               └─rlang::abort(...)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-devel-linux-x86_64-debian-clang

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/kantorovich.Rcheck/00install.out’ for details.
NOTE r-devel-linux-x86_64-debian-gcc

CRAN incoming feasibility

Maintainer: ‘Stéphane Laurent <laurent_step@outlook.fr>’

No Authors@R field in DESCRIPTION.
Please add one, modifying
  Authors@R: person(given = "Stéphane",
                    family = "Laurent",
                    role = c("aut", "cre"),
                    email = "laurent_step@outlook.fr")
as necessary.
NOTE r-devel-linux-x86_64-debian-gcc

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-devel-linux-x86_64-debian-gcc

examples

Running examples in ‘kantorovich-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
Backtrace:
     ▆
  1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
  2.   └─CVXR::psolve(problem, solver = solver, ...)
  3.     └─CVXR::solve_via_data(...)
  4.       ├─S7::S7_dispatch()
  5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
  6.         └─CVXR::solve_via_data(...)
  7.           ├─S7::S7_dispatch()
  8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
  9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
 10.               └─rlang::abort(...)
Execution halted
ERROR r-devel-linux-x86_64-debian-gcc

re-building of vignette outputs

Error(s) in re-building vignettes:
  ...
--- re-building ‘kantorovich.Rmd’ using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
 2.   └─CVXR::psolve(problem, solver = solver, ...)
 3.     └─CVXR::solve_via_data(...)
 4.       ├─S7::S7_dispatch()
 5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
 6.         └─CVXR::solve_via_data(...)
 7.           ├─S7::S7_dispatch()
 8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
Package ECOSolveR is required but not installed.
--- failed re-building ‘kantorovich.Rmd’

SUMMARY: processing the following file failed:
  ‘kantorovich.Rmd’

Error: Vignette re-building failed.
Execution halted
ERROR r-devel-linux-x86_64-debian-gcc

tests

Running ‘testthat.R’ [6s/8s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in ``method(solve_via_data, CVXR::ECOS_Solver)`(x = <object>, data = list(c = c(0, 1, 1, 1, 0, 1, 1, 1, 0), A = new("dgCMatrix", i = c(0L, 3L, 6L, 0L, 4L, 7L, 0L, 5L, 8L, 1L, 3L, 9L, 1L, 4L, 10L, 1L, 5L, 11L, 2L, 3L, 12L, 2L, 4L, 13L, 2L, 5L,
...[truncated]...
857143, 0.285714285714286,  0.571428571428571, 0.333333333333333, 0.111111111111111, 0.555555555555556, 0, 0, 0, 0, 0, 0, 0, 0, 0), dims = <object>, bool_idx = integer(0), int_idx = integer(0)), warm_start = FALSE, verbose = FALSE, solver_opts = list(), ...)`: Package ECOSolveR is required but not installed.
  Backtrace:
       ▆
    1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
    2.   └─CVXR::psolve(problem, solver = solver, ...)
    3.     └─CVXR::solve_via_data(...)
    4.       ├─S7::S7_dispatch()
    5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
    6.         └─CVXR::solve_via_data(...)
    7.           ├─S7::S7_dispatch()
    8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
    9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
   10.               └─rlang::abort(...)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-devel-linux-x86_64-debian-gcc

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/kantorovich.Rcheck/00install.out’ for details.
NOTE r-devel-linux-x86_64-fedora-clang

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-devel-linux-x86_64-fedora-clang

examples

Running examples in ‘kantorovich-Ex.R’ failed
The error most likely occurred in:

> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
Backtrace:
     ▆
  1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
  2.   └─CVXR::psolve(problem, solver = solver, ...)
  3.     └─CVXR::solve_via_data(...)
  4.       ├─S7::S7_dispatch()
  5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
  6.         └─CVXR::solve_via_data(...)
  7.           ├─S7::S7_dispatch()
  8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
  9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
 10.               └─rlang::abort(...)
Execution halted
ERROR r-devel-linux-x86_64-fedora-clang

re-building of vignette outputs

Error(s) in re-building vignettes:
--- re-building ‘kantorovich.Rmd’ using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
 2.   └─CVXR::psolve(problem, solver = solver, ...)
 3.     └─CVXR::solve_via_data(...)
 4.       ├─S7::S7_dispatch()
 5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
 6.         └─CVXR::solve_via_data(...)
 7.           ├─S7::S7_dispatch()
 8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
Package ECOSolveR is required but not installed.
--- failed re-building ‘kantorovich.Rmd’

SUMMARY: processing the following file failed:
  ‘kantorovich.Rmd’

Error: Vignette re-building failed.
Execution halted
ERROR r-devel-linux-x86_64-fedora-clang

tests

Running ‘testthat.R’ [14s/39s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in ``method(solve_via_data, CVXR::ECOS_Solver)`(x = <object>, data = list(c = c(0, 1, 1, 1, 0, 1, 1, 1, 0), A = new("dgCMatrix", i = c(0L, 3L, 6L, 0L, 4L, 7L, 0L, 5L, 8L, 1L, 3L, 9L, 1L, 4L, 10L, 1L, 5L, 11L, 2L, 3L, 12L, 2L, 4L, 13L, 2L, 5
...[truncated]...
857143, 0.285714285714286,  0.571428571428571, 0.333333333333333, 0.111111111111111, 0.555555555555556, 0, 0, 0, 0, 0, 0, 0, 0, 0), dims = <object>, bool_idx = integer(0), int_idx = integer(0)), warm_start = FALSE, verbose = FALSE, solver_opts = list(), ...)`: Package ECOSolveR is required but not installed.
  Backtrace:
       ▆
    1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
    2.   └─CVXR::psolve(problem, solver = solver, ...)
    3.     └─CVXR::solve_via_data(...)
    4.       ├─S7::S7_dispatch()
    5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
    6.         └─CVXR::solve_via_data(...)
    7.           ├─S7::S7_dispatch()
    8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
    9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
   10.               └─rlang::abort(...)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-devel-linux-x86_64-fedora-clang

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/data/gannet/ripley/R/packages/tests-clang/kantorovich.Rcheck/00install.out’ for details.
NOTE r-devel-linux-x86_64-fedora-gcc

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-devel-linux-x86_64-fedora-gcc

examples

Running examples in ‘kantorovich-Ex.R’ failed
The error most likely occurred in:

> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in kanto$status : $ operator is invalid for atomic vectors
Calls: kantorovich_CVX
Execution halted
ERROR r-devel-linux-x86_64-fedora-gcc

re-building of vignette outputs

Error(s) in re-building vignettes:
--- re-building ‘kantorovich.Rmd’ using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `kanto$status`:
! $ operator is invalid for atomic vectors
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
$ operator is invalid for atomic vectors
--- failed re-building ‘kantorovich.Rmd’

SUMMARY: processing the following file failed:
  ‘kantorovich.Rmd’

Error: Vignette re-building failed.
Execution halted
ERROR r-devel-linux-x86_64-fedora-gcc

tests

Running ‘testthat.R’ [12s/13s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in `kanto$status`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. └─kantorovich::kantorovich_CVX(mu, nu, dist = 1 - diag(3L)) at test-CVX.R:6:3
  ── Error ('test-CVX.R:16:3'): kantorovich_CVX - specified distance ─────────────
  Error in `kanto$status`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. └─kantorovich::kantorovich_CVX(mu, nu, dist = dist) at test-CVX.R:16:3
  ── Error ('test-CVX.R:37:3'): kantorovich_CVX - nonsymmetric dist ──────────────
  Error in `kanto$status`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-devel-linux-x86_64-fedora-gcc

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/data/gannet/ripley/R/packages/tests-devel/kantorovich.Rcheck/00install.out’ for details.
NOTE r-devel-macos-arm64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-devel-macos-arm64

examples

Running examples in ‘kantorovich-Ex.R’ failed
The error most likely occurred in:

> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in kanto$status : $ operator is invalid for atomic vectors
Calls: kantorovich_CVX
Execution halted
ERROR r-devel-macos-arm64

re-building of vignette outputs

Error(s) in re-building vignettes:
--- re-building ‘kantorovich.Rmd’ using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `kanto$status`:
! $ operator is invalid for atomic vectors
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
$ operator is invalid for atomic vectors
--- failed re-building ‘kantorovich.Rmd’

SUMMARY: processing the following file failed:
  ‘kantorovich.Rmd’

Error: Vignette re-building failed.
Execution halted
ERROR r-devel-macos-arm64

tests

Running ‘testthat.R’ [2s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in `kanto$status`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. └─kantorovich::kantorovich_CVX(mu, nu, dist = 1 - diag(3L)) at test-CVX.R:6:3
  ── Error ('test-CVX.R:16:3'): kantorovich_CVX - specified distance ─────────────
  Error in `kanto$status`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. └─kantorovich::kantorovich_CVX(mu, nu, dist = dist) at test-CVX.R:16:3
  ── Error ('test-CVX.R:37:3'): kantorovich_CVX - nonsymmetric dist ──────────────
  Error in `kanto$status`: $ operator is invalid for atomic vectors
  Backtrace:
      ▆
   1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-devel-macos-arm64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/Volumes/Builds/packages/sonoma-arm64/results/4.6/kantorovich.Rcheck/00install.out’ for details.
NOTE r-devel-windows-x86_64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    'kantorovich_ompr.R'
ERROR r-devel-windows-x86_64

examples

Running examples in 'kantorovich-Ex.R' failed
The error most likely occurred in:

> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
Backtrace:
     ▆
  1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
  2.   └─CVXR::psolve(problem, solver = solver, ...)
  3.     └─CVXR::solve_via_data(...)
  4.       ├─S7::S7_dispatch()
  5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
  6.         └─CVXR::solve_via_data(...)
  7.           ├─S7::S7_dispatch()
  8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
  9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
 10.               └─rlang::abort(...)
Execution halted
ERROR r-devel-windows-x86_64

re-building of vignette outputs

Error(s) in re-building vignettes:
--- re-building 'kantorovich.Rmd' using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
 2.   └─CVXR::psolve(problem, solver = solver, ...)
 3.     └─CVXR::solve_via_data(...)
 4.       ├─S7::S7_dispatch()
 5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
 6.         └─CVXR::solve_via_data(...)
 7.           ├─S7::S7_dispatch()
 8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
Package ECOSolveR is required but not installed.
--- failed re-building 'kantorovich.Rmd'

SUMMARY: processing the following file failed:
  'kantorovich.Rmd'

Error: Vignette re-building failed.
Execution halted
ERROR r-devel-windows-x86_64

tests

Running 'testthat.R' [7s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in ``method(solve_via_data, CVXR::ECOS_Solver)`(x = <object>, data = list(c = c(0, 1, 1, 1, 0, 1, 1, 1, 0), A = new("dgCMatrix", i = c(0L, 3L, 6L, 0L, 4L, 7L, 0L, 5L, 8L, 1L, 3L, 9L, 1L, 4L, 10L, 1L, 5L, 11L, 2L, 3L, 12L, 2L, 4L, 13L, 2L, 5L, 14
...[truncated]...
857143, 0.285714285714286,  0.571428571428571, 0.333333333333333, 0.111111111111111, 0.555555555555556, 0, 0, 0, 0, 0, 0, 0, 0, 0), dims = <object>, bool_idx = integer(0), int_idx = integer(0)), warm_start = FALSE, verbose = FALSE, solver_opts = list(), ...)`: Package ECOSolveR is required but not installed.
  Backtrace:
       ▆
    1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
    2.   └─CVXR::psolve(problem, solver = solver, ...)
    3.     └─CVXR::solve_via_data(...)
    4.       ├─S7::S7_dispatch()
    5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
    6.         └─CVXR::solve_via_data(...)
    7.           ├─S7::S7_dispatch()
    8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
    9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
   10.               └─rlang::abort(...)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-devel-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich'
See 'd:/Rcompile/CRANpkg/local/4.6/kantorovich.Rcheck/00install.out' for details.
ERROR r-oldrel-windows-x86_64

examples

Running examples in 'kantorovich-Ex.R' failed
The error most likely occurred in:

> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
Backtrace:
     ▆
  1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
  2.   └─CVXR::psolve(problem, solver = solver, ...)
  3.     └─CVXR::solve_via_data(...)
  4.       ├─S7::S7_dispatch()
  5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
  6.         └─CVXR::solve_via_data(...)
  7.           ├─S7::S7_dispatch()
  8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
  9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
 10.               └─rlang::abort(...)
Execution halted
ERROR r-oldrel-windows-x86_64

re-building of vignette outputs

Error(s) in re-building vignettes:
--- re-building 'kantorovich.Rmd' using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
 2.   └─CVXR::psolve(problem, solver = solver, ...)
 3.     └─CVXR::solve_via_data(...)
 4.       ├─S7::S7_dispatch()
 5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
 6.         └─CVXR::solve_via_data(...)
 7.           ├─S7::S7_dispatch()
 8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
Package ECOSolveR is required but not installed.
--- failed re-building 'kantorovich.Rmd'

SUMMARY: processing the following file failed:
  'kantorovich.Rmd'

Error: Vignette re-building failed.
Execution halted
ERROR r-oldrel-windows-x86_64

tests

Running 'testthat.R' [9s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in ``method(solve_via_data, CVXR::ECOS_Solver)`(x = <object>, data = list(c = c(0, 1, 1, 1, 0, 1, 1, 1, 0), A = new("dgCMatrix", i = c(0L, 3L, 6L, 0L, 4L, 7L, 0L, 5L, 8L, 1L, 3L, 9L, 1L, 4L, 10L, 1L, 5L, 11L, 2L, 3L, 12L, 2L, 4L, 13L, 2L, 5L, 14
...[truncated]...
857143, 0.285714285714286,  0.571428571428571, 0.333333333333333, 0.111111111111111, 0.555555555555556, 0, 0, 0, 0, 0, 0, 0, 0, 0), dims = <object>, bool_idx = integer(0), int_idx = integer(0)), warm_start = FALSE, verbose = FALSE, solver_opts = list(), ...)`: Package ECOSolveR is required but not installed.
  Backtrace:
       ▆
    1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
    2.   └─CVXR::psolve(problem, solver = solver, ...)
    3.     └─CVXR::solve_via_data(...)
    4.       ├─S7::S7_dispatch()
    5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
    6.         └─CVXR::solve_via_data(...)
    7.           ├─S7::S7_dispatch()
    8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
    9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
   10.               └─rlang::abort(...)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-oldrel-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich'
See 'd:/Rcompile/CRANpkg/local/4.4/kantorovich.Rcheck/00install.out' for details.
NOTE r-patched-linux-x86_64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-patched-linux-x86_64

examples

Running examples in ‘kantorovich-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
Backtrace:
     ▆
  1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
  2.   └─CVXR::psolve(problem, solver = solver, ...)
  3.     └─CVXR::solve_via_data(...)
  4.       ├─S7::S7_dispatch()
  5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
  6.         └─CVXR::solve_via_data(...)
  7.           ├─S7::S7_dispatch()
  8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
  9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
 10.               └─rlang::abort(...)
Execution halted
ERROR r-patched-linux-x86_64

re-building of vignette outputs

Error(s) in re-building vignettes:
  ...
--- re-building ‘kantorovich.Rmd’ using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
 2.   └─CVXR::psolve(problem, solver = solver, ...)
 3.     └─CVXR::solve_via_data(...)
 4.       ├─S7::S7_dispatch()
 5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
 6.         └─CVXR::solve_via_data(...)
 7.           ├─S7::S7_dispatch()
 8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
Package ECOSolveR is required but not installed.
--- failed re-building ‘kantorovich.Rmd’

SUMMARY: processing the following file failed:
  ‘kantorovich.Rmd’

Error: Vignette re-building failed.
Execution halted
ERROR r-patched-linux-x86_64

tests

Running ‘testthat.R’ [8s/9s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in ``method(solve_via_data, CVXR::ECOS_Solver)`(x = <object>, data = list(c = c(0, 1, 1, 1, 0, 1, 1, 1, 0), A = new("dgCMatrix", i = c(0L, 3L, 6L, 0L, 4L, 7L, 0L, 5L, 8L, 1L, 3L, 9L, 1L, 4L, 10L, 1L, 5L, 11L, 2L, 3L, 12L, 2L, 4L, 13L, 2L, 5L,
...[truncated]...
857143, 0.285714285714286,  0.571428571428571, 0.333333333333333, 0.111111111111111, 0.555555555555556, 0, 0, 0, 0, 0, 0, 0, 0, 0), dims = <object>, bool_idx = integer(0), int_idx = integer(0)), warm_start = FALSE, verbose = FALSE, solver_opts = list(), ...)`: Package ECOSolveR is required but not installed.
  Backtrace:
       ▆
    1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
    2.   └─CVXR::psolve(problem, solver = solver, ...)
    3.     └─CVXR::solve_via_data(...)
    4.       ├─S7::S7_dispatch()
    5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
    6.         └─CVXR::solve_via_data(...)
    7.           ├─S7::S7_dispatch()
    8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
    9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
   10.               └─rlang::abort(...)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-patched-linux-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/home/hornik/tmp/R.check/r-patched-gcc/Work/PKGS/kantorovich.Rcheck/00install.out’ for details.
NOTE r-release-linux-x86_64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-release-linux-x86_64

examples

Running examples in ‘kantorovich-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
Backtrace:
     ▆
  1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
  2.   └─CVXR::psolve(problem, solver = solver, ...)
  3.     └─CVXR::solve_via_data(...)
  4.       ├─S7::S7_dispatch()
  5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
  6.         └─CVXR::solve_via_data(...)
  7.           ├─S7::S7_dispatch()
  8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
  9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
 10.               └─rlang::abort(...)
Execution halted
ERROR r-release-linux-x86_64

re-building of vignette outputs

Error(s) in re-building vignettes:
  ...
--- re-building ‘kantorovich.Rmd’ using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
 2.   └─CVXR::psolve(problem, solver = solver, ...)
 3.     └─CVXR::solve_via_data(...)
 4.       ├─S7::S7_dispatch()
 5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
 6.         └─CVXR::solve_via_data(...)
 7.           ├─S7::S7_dispatch()
 8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
Package ECOSolveR is required but not installed.
--- failed re-building ‘kantorovich.Rmd’

SUMMARY: processing the following file failed:
  ‘kantorovich.Rmd’

Error: Vignette re-building failed.
Execution halted
ERROR r-release-linux-x86_64

tests

Running ‘testthat.R’ [8s/8s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in ``method(solve_via_data, CVXR::ECOS_Solver)`(x = <object>, data = list(c = c(0, 1, 1, 1, 0, 1, 1, 1, 0), A = new("dgCMatrix", i = c(0L, 3L, 6L, 0L, 4L, 7L, 0L, 5L, 8L, 1L, 3L, 9L, 1L, 4L, 10L, 1L, 5L, 11L, 2L, 3L, 12L, 2L, 4L, 13L, 2L, 5L,
...[truncated]...
857143, 0.285714285714286,  0.571428571428571, 0.333333333333333, 0.111111111111111, 0.555555555555556, 0, 0, 0, 0, 0, 0, 0, 0, 0), dims = <object>, bool_idx = integer(0), int_idx = integer(0)), warm_start = FALSE, verbose = FALSE, solver_opts = list(), ...)`: Package ECOSolveR is required but not installed.
  Backtrace:
       ▆
    1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
    2.   └─CVXR::psolve(problem, solver = solver, ...)
    3.     └─CVXR::solve_via_data(...)
    4.       ├─S7::S7_dispatch()
    5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
    6.         └─CVXR::solve_via_data(...)
    7.           ├─S7::S7_dispatch()
    8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
    9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
   10.               └─rlang::abort(...)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-release-linux-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/home/hornik/tmp/R.check/r-release-gcc/Work/PKGS/kantorovich.Rcheck/00install.out’ for details.
NOTE r-release-macos-arm64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
NOTE r-release-macos-x86_64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
NOTE r-release-windows-x86_64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    'kantorovich_ompr.R'
ERROR r-release-windows-x86_64

examples

Running examples in 'kantorovich-Ex.R' failed
The error most likely occurred in:

> ### Name: kantorovich_CVX
> ### Title: Computes Kantorovich distance with CVX
> ### Aliases: kantorovich_CVX
> 
> ### ** Examples
> 
> x <- c(1.5, 2, -3)
> mu <- c(1/7, 2/7, 4/7)
> y <- c(4, 3.5, 0, -2)
> nu <- c(1/4, 1/4, 1/4, 1/4)
> M <- outer(x, y, FUN = function(x, y) abs(x - y))
> kantorovich_CVX(mu, nu, dist = M)
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
Backtrace:
     ▆
  1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
  2.   └─CVXR::psolve(problem, solver = solver, ...)
  3.     └─CVXR::solve_via_data(...)
  4.       ├─S7::S7_dispatch()
  5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
  6.         └─CVXR::solve_via_data(...)
  7.           ├─S7::S7_dispatch()
  8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
  9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
 10.               └─rlang::abort(...)
Execution halted
ERROR r-release-windows-x86_64

re-building of vignette outputs

Error(s) in re-building vignettes:
--- re-building 'kantorovich.Rmd' using rmarkdown

Quitting from kantorovich.Rmd:176-189 [unnamed-chunk-14]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `method(solve_via_data, CVXR::ECOS_Solver)`:
! Package ECOSolveR is required but not installed.
---
Backtrace:
    ▆
 1. └─kantorovich::kantorovich_CVX(mu, nu, dist = M)
 2.   └─CVXR::psolve(problem, solver = solver, ...)
 3.     └─CVXR::solve_via_data(...)
 4.       ├─S7::S7_dispatch()
 5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
 6.         └─CVXR::solve_via_data(...)
 7.           ├─S7::S7_dispatch()
 8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'kantorovich.Rmd' failed with diagnostics:
Package ECOSolveR is required but not installed.
--- failed re-building 'kantorovich.Rmd'

SUMMARY: processing the following file failed:
  'kantorovich.Rmd'

Error: Vignette re-building failed.
Execution halted
ERROR r-release-windows-x86_64

tests

Running 'testthat.R' [7s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(kantorovich)
  Warning message:
  replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich' 
  > library(gmp)
  
  Attaching package: 'gmp'
  
  The following objects are masked from 'package:base':
  
      %*%, apply, crossprod, matrix, tcrossprod
  
  > 
  > test_check("kantorovich")
  Saving _problems/test-CVX-6.R
  Saving _problems/test-CVX-16.R
  Saving _problems/test-CVX-37.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CVX.R:6:3'): kantorovich_CVX default distance ──────────────────
  Error in ``method(solve_via_data, CVXR::ECOS_Solver)`(x = <object>, data = list(c = c(0, 1, 1, 1, 0, 1, 1, 1, 0), A = new("dgCMatrix", i = c(0L, 3L, 6L, 0L, 4L, 7L, 0L, 5L, 8L, 1L, 3L, 9L, 1L, 4L, 10L, 1L, 5L, 11L, 2L, 3L, 12L, 2L, 4L, 13L, 2L, 5L, 14
...[truncated]...
857143, 0.285714285714286,  0.571428571428571, 0.333333333333333, 0.111111111111111, 0.555555555555556, 0, 0, 0, 0, 0, 0, 0, 0, 0), dims = <object>, bool_idx = integer(0), int_idx = integer(0)), warm_start = FALSE, verbose = FALSE, solver_opts = list(), ...)`: Package ECOSolveR is required but not installed.
  Backtrace:
       ▆
    1. └─kantorovich::kantorovich_CVX(mu, nu, dist = D) at test-CVX.R:37:3
    2.   └─CVXR::psolve(problem, solver = solver, ...)
    3.     └─CVXR::solve_via_data(...)
    4.       ├─S7::S7_dispatch()
    5.       └─CVXR (local) `method(solve_via_data, CVXR::SolvingChain)`(...)
    6.         └─CVXR::solve_via_data(...)
    7.           ├─S7::S7_dispatch()
    8.           └─CVXR (local) `method(solve_via_data, CVXR::ECOS_Solver)`(...)
    9.             └─cli::cli_abort("Package {.pkg ECOSolveR} is required but not installed.")
   10.               └─rlang::abort(...)
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 130 ]
  Error:
  ! Test failures.
  Execution halted
WARNING r-release-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich'
See 'd:/Rcompile/CRANpkg/local/4.5/kantorovich.Rcheck/00install.out' for details.

Check History

ERROR 2 OK · 4 NOTE · 0 WARNING · 8 ERROR · 0 FAILURE Mar 10, 2026
ERROR r-devel-linux-x86_64-debian-clang

CRAN incoming feasibility

Maintainer: ‘Stéphane Laurent <laurent_step@outlook.fr>’

No Authors@R field in DESCRIPTION.
Please add one, modifying
  Authors@R: person(given = "Stéphane",
                    family = "Laurent",
                    role = c("aut", "cre"),
                    email = "laurent_step@outlook.fr")
as necessary.
ERROR r-devel-linux-x86_64-debian-gcc

CRAN incoming feasibility

Maintainer: ‘Stéphane Laurent <laurent_step@outlook.fr>’

No Authors@R field in DESCRIPTION.
Please add one, modifying
  Authors@R: person(given = "Stéphane",
                    family = "Laurent",
                    role = c("aut", "cre"),
                    email = "laurent_step@outlook.fr")
as necessary.
ERROR r-devel-linux-x86_64-fedora-clang

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/data/gannet/ripley/R/packages/tests-clang/kantorovich.Rcheck/00install.out’ for details.
ERROR r-devel-linux-x86_64-fedora-gcc

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/data/gannet/ripley/R/packages/tests-devel/kantorovich.Rcheck/00install.out’ for details.
NOTE r-devel-macos-arm64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-devel-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich'
See 'd:/Rcompile/CRANpkg/local/4.6/kantorovich.Rcheck/00install.out' for details.
NOTE r-patched-linux-x86_64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-release-linux-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import ‘CVXR::outer’ by ‘gmp::outer’ when loading ‘kantorovich’
See ‘/home/hornik/tmp/R.check/r-release-gcc/Work/PKGS/kantorovich.Rcheck/00install.out’ for details.
NOTE r-release-macos-arm64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
NOTE r-release-macos-x86_64

DESCRIPTION meta-information

Missing dependency on R >= 4.1.0 because package code uses the pipe
  |> or function shorthand \(...) syntax added in R 4.1.0.
  File(s) using such syntax:
    ‘kantorovich_ompr.R’
ERROR r-release-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich'
See 'd:/Rcompile/CRANpkg/local/4.5/kantorovich.Rcheck/00install.out' for details.
ERROR r-oldrel-windows-x86_64

whether package can be installed

Found the following significant warnings:
  Warning: replacing previous import 'CVXR::outer' by 'gmp::outer' when loading 'kantorovich'
See 'd:/Rcompile/CRANpkg/local/4.4/kantorovich.Rcheck/00install.out' for details.

Reverse Dependencies (1)

imports

Dependency Network

Dependencies Reverse dependencies CVXR gmp lpSolve rcdd Rglpk slam ompr ompr.roi ROI.plugin.glpk bratteli kantorovich

Version History

new 3.2.0 Mar 10, 2026
updated 3.2.0 ← 3.1.0 diff Apr 22, 2024
updated 3.1.0 ← 3.0.1 diff Aug 21, 2023
updated 3.0.1 ← 3.0.0 diff Aug 9, 2022
updated 3.0.0 ← 2.0.1 diff Oct 27, 2020
updated 2.0.1 ← 2.0.0 diff Aug 25, 2020
updated 2.0.0 ← 1.1.0 diff May 24, 2016
updated 1.1.0 ← 1.0.0 diff Feb 3, 2016
new 1.0.0 Jan 14, 2016