Skip to content

cuadramelo

Matrix Balancing and Rounding

v1.0.0 · Oct 10, 2024 · GPL (>= 3)

Description

Balancing and rounding matrices subject to restrictions. Adjustment of matrices so that columns and rows add up to given vectors, rounding of a matrix while keeping the column and/or row totals, performing these by blocks...

Downloads

202

Last 30 days

22310th

509

Last 90 days

1.9K

Last year

Trend: +20.2% (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 (41 non-OK)
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
WARNING r-devel-linux-x86_64-debian-clang

dependencies in R code

Missing or unexported object: ‘CVXR::solve’
ERROR r-devel-linux-x86_64-debian-clang

examples

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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─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 ‘balance-matrix.Rmd’ using rmarkdown

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building ‘balance-matrix.Rmd’

--- re-building ‘round-matrix.Rmd’ using rmarkdown
--- finished re-building ‘round-matrix.Rmd’

SUMMARY: processing the following file failed:
  ‘balance-matrix.Rmd’

Error: Vignette re-building failed.
Execution halted
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
WARNING r-devel-linux-x86_64-debian-gcc

dependencies in R code

Missing or unexported object: ‘CVXR::solve’
ERROR r-devel-linux-x86_64-debian-gcc

examples

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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─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 ‘balance-matrix.Rmd’ using rmarkdown

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building ‘balance-matrix.Rmd’

--- re-building ‘round-matrix.Rmd’ using rmarkdown
--- finished re-building ‘round-matrix.Rmd’

SUMMARY: processing the following file failed:
  ‘balance-matrix.Rmd’

Error: Vignette re-building failed.
Execution halted
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
WARNING r-devel-linux-x86_64-fedora-clang

dependencies in R code

Missing or unexported object: ‘CVXR::solve’
ERROR r-devel-linux-x86_64-fedora-clang

examples

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

> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─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 ‘balance-matrix.Rmd’ using rmarkdown

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building ‘balance-matrix.Rmd’

--- re-building ‘round-matrix.Rmd’ using rmarkdown
--- finished re-building ‘round-matrix.Rmd’

SUMMARY: processing the following file failed:
  ‘balance-matrix.Rmd’

Error: Vignette re-building failed.
Execution halted
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
WARNING r-devel-linux-x86_64-fedora-gcc

dependencies in R code

Missing or unexported object: ‘CVXR::solve’
ERROR r-devel-linux-x86_64-fedora-gcc

examples

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

> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─rlang::abort(...)
Execution halted
ERROR r-devel-linux-x86_64-fedora-gcc

re-building of vignette outputs

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

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building ‘balance-matrix.Rmd’

--- re-building ‘round-matrix.Rmd’ using rmarkdown
--- finished re-building ‘round-matrix.Rmd’

SUMMARY: processing the following file failed:
  ‘balance-matrix.Rmd’

Error: Vignette re-building failed.
Execution halted
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
WARNING r-devel-macos-arm64

dependencies in R code

Missing or unexported object: ‘CVXR::solve’
ERROR r-devel-macos-arm64

examples

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

> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─rlang::abort(...)
Execution halted
ERROR r-devel-macos-arm64

re-building of vignette outputs

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

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building ‘balance-matrix.Rmd’

--- re-building ‘round-matrix.Rmd’ using rmarkdown
--- finished re-building ‘round-matrix.Rmd’

SUMMARY: processing the following file failed:
  ‘balance-matrix.Rmd’

Error: Vignette re-building failed.
Execution halted
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:
    'apply_by_blocks.R' 'balance_by_blocks.Rd' 'balance_matrix.R'
    'balance_matrix.Rd' 'make_non_negative.Rd' 'round_by_blocks.Rd'
    'round_matrix.R' 'round_matrix.Rd' 'round_vector.Rd'
WARNING r-devel-windows-x86_64

dependencies in R code

Missing or unexported object: 'CVXR::solve'
ERROR r-devel-windows-x86_64

examples

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

> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─rlang::abort(...)
Execution halted
ERROR r-devel-windows-x86_64

re-building of vignette outputs

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

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building 'balance-matrix.Rmd'

--- re-building 'round-matrix.Rmd' using rmarkdown
--- finished re-building 'round-matrix.Rmd'

SUMMARY: processing the following file failed:
  'balance-matrix.Rmd'

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

dependencies in R code

Missing or unexported object: 'CVXR::solve'
ERROR r-oldrel-windows-x86_64

examples

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

> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─rlang::abort(...)
Execution halted
ERROR r-oldrel-windows-x86_64

re-building of vignette outputs

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

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building 'balance-matrix.Rmd'

--- re-building 'round-matrix.Rmd' using rmarkdown
--- finished re-building 'round-matrix.Rmd'

SUMMARY: processing the following file failed:
  'balance-matrix.Rmd'

Error: Vignette re-building failed.
Execution halted
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
WARNING r-patched-linux-x86_64

dependencies in R code

Missing or unexported object: ‘CVXR::solve’
ERROR r-patched-linux-x86_64

examples

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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─rlang::abort(...)
Execution halted
ERROR r-patched-linux-x86_64

re-building of vignette outputs

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

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building ‘balance-matrix.Rmd’

--- re-building ‘round-matrix.Rmd’ using rmarkdown
--- finished re-building ‘round-matrix.Rmd’

SUMMARY: processing the following file failed:
  ‘balance-matrix.Rmd’

Error: Vignette re-building failed.
Execution halted
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
WARNING r-release-linux-x86_64

dependencies in R code

Missing or unexported object: ‘CVXR::solve’
ERROR r-release-linux-x86_64

examples

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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─rlang::abort(...)
Execution halted
ERROR r-release-linux-x86_64

re-building of vignette outputs

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

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building ‘balance-matrix.Rmd’

--- re-building ‘round-matrix.Rmd’ using rmarkdown
--- finished re-building ‘round-matrix.Rmd’

SUMMARY: processing the following file failed:
  ‘balance-matrix.Rmd’

Error: Vignette re-building failed.
Execution halted
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
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:
    'apply_by_blocks.R' 'balance_by_blocks.Rd' 'balance_matrix.R'
    'balance_matrix.Rd' 'make_non_negative.Rd' 'round_by_blocks.Rd'
    'round_matrix.R' 'round_matrix.Rd' 'round_vector.Rd'
WARNING r-release-windows-x86_64

dependencies in R code

Missing or unexported object: 'CVXR::solve'
ERROR r-release-windows-x86_64

examples

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

> ### Name: balance_by_blocks
> ### Title: Balance matrix by blocks
> ### Aliases: balance_by_blocks
> 
> ### ** Examples
> 
> set.seed(10)
> Y <- (rnorm(32)*10) |> matrix(ncol = 2) |> round(3)
> v <- aggregate(Y, by = list(rep(1:4, times = rep(4,4))), FUN = sum)[, -1] |>
+   round() |> as.matrix()
> X <- balance_by_blocks(Y, v, layout = 2, L = 4)
Error in `Variable()`:
! Variable name "2" must be a string.
Backtrace:
    ▆
 1. └─cuadramelo::balance_by_blocks(Y, v, layout = 2, L = 4)
 2.   └─cuadramelo::balance_matrix(X, col_totals = v, row_totals = h)
 3.     └─CVXR::Variable(m, n)
 4.       └─cli::cli_abort("Variable name {.val {as.character(name)}} must be a string.")
 5.         └─rlang::abort(...)
Execution halted
ERROR r-release-windows-x86_64

re-building of vignette outputs

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

Quitting from balance-matrix.Rmd:59-64 [unnamed-chunk-6]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `Variable()`:
! Variable name "5" must be a string.
---
Backtrace:
    ▆
 1. └─cuadramelo::balance_matrix(example_matrix, col_totals, row_totals)
 2.   └─CVXR::Variable(m, n)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'balance-matrix.Rmd' failed with diagnostics:
Variable name "5" must be a string.
--- failed re-building 'balance-matrix.Rmd'

--- re-building 'round-matrix.Rmd' using rmarkdown
--- finished re-building 'round-matrix.Rmd'

SUMMARY: processing the following file failed:
  'balance-matrix.Rmd'

Error: Vignette re-building failed.
Execution halted

Check History

ERROR 2 OK · 4 NOTE · 0 WARNING · 8 ERROR · 0 FAILURE Mar 10, 2026
ERROR 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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
ERROR 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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
ERROR 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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
ERROR 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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
ERROR 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:
    'apply_by_blocks.R' 'balance_by_blocks.Rd' 'balance_matrix.R'
    'balance_matrix.Rd' 'make_non_negative.Rd' 'round_by_blocks.Rd'
    'round_matrix.R' 'round_matrix.Rd' 'round_vector.Rd'
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
ERROR 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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
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:
    ‘apply_by_blocks.R’ ‘balance_by_blocks.Rd’ ‘balance_matrix.R’
    ‘balance_matrix.Rd’ ‘make_non_negative.Rd’ ‘round_by_blocks.Rd’
    ‘round_matrix.R’ ‘round_matrix.Rd’ ‘round_vector.Rd’
ERROR 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:
    'apply_by_blocks.R' 'balance_by_blocks.Rd' 'balance_matrix.R'
    'balance_matrix.Rd' 'make_non_negative.Rd' 'round_by_blocks.Rd'
    'round_matrix.R' 'round_matrix.Rd' 'round_vector.Rd'
ERROR r-oldrel-windows-x86_64

dependencies in R code

Missing or unexported object: 'CVXR::solve'

Dependency Network

Dependencies Reverse dependencies CVXR dplyr cuadramelo

Version History

new 1.0.0 Mar 10, 2026