tol
argument to clean_byname()
, allowing for machine precision issues to be addressed.rename_to_pref_suff_byname()
, aggregate_byname()
, and aggregate_to_pref_suff_byname()
respect notation when using notation to renaming rows and columns.notation_vec()
, arrow_notation()
, paren_notation()
, bracket_notation()
, split_pref_suff()
, join_pref_suff()
, flip_pref_suff()
, switch_notation()
, and switch_notation_byname()
.README.md
requiring a nonempty <title>
element.prep_vector_arg()
to duplicate matrices when present as the vector_arg.sort_rows_cols()
. Now telling which row or column names are duplicates.aggregate_pref_suff_byname()
that combines rename_to_pref_suff_byname()
and aggregate_byname()
.aggregate_byname()
collapsed all rows or columns into a single row or single column or both.aggregate_byname()
which aggregates rows, columns, or both, according to an aggregation_map
. I wanted to add this function for a long time, and I finally found a reason, namely the need to aggregate by prefixes or suffixes in the IEATools
package. Furthermore, the aggregation_map
idea seems to be solid. Note that aggregation_map = NULL
(the default) aggregates rows with same names and columns with same names.rename_rowcol_to_pref_suff_byname()
which renames rows or columns to prefixes or suffixes in row and column names.clean_byname()
which caused a NULL
response when unnamed rows or columns were present.prepare_.FUNdots()
function in all *apply_byname()
functions.unaryapply_byname()
into function prepare_.FUNdots()
, so it can be used in other *apply_byname()
functions.unaryapply_byname()
, which was not correctly handling a rectangular two-dimensional list of arguments to FUN
supplied in .FUNdots
. A rectangular two-dimensional list of arguments in .FUNdots
is now interpreted as follows:
FUN
.a
..FUNdots
is the number of arguments supplied to FUN
. The length of the second dimension of .FUNdots
must be equal to the length of a
.dplyr
1.0.0. Several tests and examples in matsbyname
needed a column of a data frame constructed with I()
. dplyr::group_by()
now requires all groups to have same type, but that wasn’t true in some tests, as some entries were I<list>
(items in groups with more than one member) and others were list
(items in single-item groups). The solution was to modify two test to
data.frame
to tibble
when creating the data frames for testing andI()
, as tibble is friendly to list columns.matricize_byname()
that converts a column (or row) vector into a matrix. matricize_byname()
is the inverse of vectorize_byname()
.vectorize_byname
that converts a matrix into a column vector.matsindf
. This section could be re-added now that matsindf
is now on CRAN.matrix
objects now inherit from both matrix
and array
. Thus, code should no longer assume that class(A)
returns an object of length 1 when A
is a matrix
. So, I eliminated all instances of class(A) == "matrix"
in if
statements in favor of inherits(A, "matrix")
. See https://developer.r-project.org/Blog/public/2019/11/09/when-you-think-class.-think-again/index.html for more details.citation("matsbyname")
now gives useful information.matrixproduct_byname
in which row and column types were not set correctly when one operand was a matrix
and the other operand was NA
.elementapply_byname()
applies a function to an element of a matrix specified by row
and col
arguments.elementproduct_byname()
changed to hadamardproduct_byname()
to avoid name collision with elementapply_byname()
.elementquotient_byname()
changed to quotient_byname()
.elementpow_byname()
changed to pow_byname()
.elementexp_byname()
changed to exp_byname()
.complete_rows_cols()
is now agnostic about the order of columns in fillrow
and the order of rows in fillcol
.sort_rows_cols()
now allows entries in roworder and colorder that are not presently names of rows or columns. Extraneous names are silently ignored.fractionize_byname()
now correctly handles non-square matrices.hatinv_byname()
now handles 0
values in input vectors gracefully. By default, 0
values become .Machine$double.xmax
.inf_becomes
to a numerical value. To suppress default behavior, set inf_becomes = NULL
.iszero_byname()
now checks if values of abs(a)
are <= tol
. (Previously, iszero_byname()
tested with < tol
.) This change allows the zero matrix to pass the test when tol = 0
, as we would want.equal_byname()
to use isTRUE(all.equal())
when checking for equality.identical_byname()
checks for exact equality using identical
.identical()
instead of isTRUE(all.equal())
for equal_byname()
function.hatinv_byname()
.count_*
functions.mc.cores
arguments to matsbyname
functions.matbyname
. Not sure if I want to keep it.all_byname()
and any_byname()
make logical tests easy.replaceNaN_byname()
replaces NaN
entries with a value (default is 0).*col*_byname
functions to call their respective *row*_byname
functions with a transposed argument, thereby simplifying code.select_cols_byname
, a NULL
result terminated the executing thread.replaceNaNWith0
.count_vals_byname
, count_vals_inrows_byname
, and count_vals_incols_byname
that return the number of matrix entries that meet a criterion for the entire matrix, in each row, and in each column, respectively.*_byname
functions.
set_mc_cores
and get_mc_cores
to set and get package-wide mc.cores
variable. Default is 1
, so all functions work as previously unless mc.cores
is more than 1
.mc.cores
argument of any function to specify the number of cores to be used for an individual calculation. Default is get_mc_cores()
. A useful approach is to set_mc_cores(detectCores(logical = FALSE))
.sum_byname(list(1,2,3,4), list(1,2,3,4), mc.cores = 4)
to send each sum to a different core.set_mc_cores(4L); sum_byname(list(1,2,3,4), list(1,2,3,4), mc.cores = 4); set_mc_cores(1L)
to do the same thing and set the package-wide value back to 1
.*apply_byname
functions enable API improvements
naryapply_byname
: enables ...
argumentsnaryapplylogical_byname
: enables logical functions...
arguments for functions that deserve them....
arguments including
sum_byname
matrixproduct_byname
elementproduct_byname
mean_byname
geometricmean_byname
equal_byname
samestructure_byname
and_byname(...)
function that provides logical and “by name.”
or_byname
, xor_byname
, and not_byname
.matsindf
. Doing so allows matsbyname
to be submitted first to CRAN. Also, Travis builds are now successful, having eliminated the circular dependence between matsbyname
and matsindf
.elementpow_byname
raises all elements of a matrix to a power.complete_rows_cols
now accepts fillrow
and fillcol
arguments. These arguments can be used (instead of the fill
argument) to specify the values of filled rows and columns when completing a matrix. When conflicts arise, precedence among the fill*
arguments is fillrow
then fillcol
then fill
.matsbyname
.*apply_byname
functions.applybyname
vignette.unaryapply_byname
and binaryapply_byname
now have .FUNdots
arguments through which arguments to FUN
should be passed. Use of the ...
argument is no longer possible. ...
is reserved for future changes to allow an unlimited number of arguments to some functions, such as sum_byname
..FUNdots
argument fixed a bug where calculations were incorrect when lists of matrices were stored in cells of a data frame. Distribution of arguments (such as margin = c(1, 2)
) across rows of a data frame was not happening properly.cumsum_byname
, cumprod_byname
, and cumapply_byname
.elementlog_byname
and elementexp_byname
.unaryapply_byname
and binaryapply_byname
. These functions have a FUN
argument that allows an arbitrary function to be applied _byname
to matrices or data frames containing matrices.
unaryapply_byname
is for unary functions such as rowsums_byname
.binaryapply_byname
is for binary functions such as sum_byname
.unaryapply_byname
and binaryapply_byname
are used by all _byname
functions internally.unaryapply
and binaryapply
functions are very solid._byname
functions when one argument was a list and the other was a non-constant numeric vector.complete_rows_cols_byname
. It no longer takes a names
argument.mean_byname
: returns the arithmetic mean of corresponding entries of two matricesgeometricmean_byname
: returns the geometric mean of corresponding entries of two matriceslogarithmicmean_byname
: returns the logarithmic mean of corresponding entries of two matricessetrownames_byname
and setcolnames_byname
on a constant would fail. It now produces a 1x1 matrix with named rows or columns.rowprod_byname
: returns a column vector with row products (product of all entries in a row)colprod_byname
: returns a row vector with column products (product of all entries in a column)prodall_byname
: returns a numeric of the product of all entries in a matrixInitial version.