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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: Iminus_byname
> ### Title: Subtract a matrix with named rows and columns from a suitably
> ###   named and sized identity matrix ('I')
> ### Aliases: Iminus_byname
> 
> ### ** Examples
> 
> m <- matrix(c(-21, -12, -21, -10), ncol = 2, dimnames = list(c("b", "a"), c("b", "a"))) %>%
+   setrowtype("Industries") %>% setcoltype("Commodities")
> # Rows and columns are unsorted
> diag(1, nrow = 2) - m 
   b  a
b 22 21
a 12 11
attr(,"rowtype")
[1] "Industries"
attr(,"coltype")
[1] "Commodities"
> # Rows and columns are sorted prior to subtracting from the identity matrix
> Iminus_byname(m) 
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
matsbyname
 --- call from context --- 
(function (a, margin) 
{
    if (class(a) == "numeric" & length(a) == 1) {
        return(1)
    }
    if (!length(margin) %in% c(1, 2)) {
        stop("margin should have length 1 or 2 in fractionize_byname")
    }
    if (length(margin) == 2 && all(margin %in% c(1, 2))) {
        stopifnot(nrow(a) == ncol(a))
        return(diag(nrow(a)) %>% setrownames_byname(rownames(a)) %>% 
            setcolnames_byname(colnames(a)) %>% setrowtype(rowtype(a)) %>% 
            setcoltype(coltype(a)))
    }
    if (length(margin) != 1 || !(margin %in% c(1, 2))) {
        stop(paste("Unknown margin", margin, "in identize_byname. margin should be 1, 2, or c(1,2)."))
    }
    if (margin == 1) {
        return(matrix(rep_len(1, nrow(a)), nrow = nrow(a), ncol = 1) %>% 
            setrownames_byname(rownames(a)) %>% setcolnames_byname(coltype(a)) %>% 
            setrowtype(rowtype(a)) %>% setcoltype(coltype(a)))
    }
    if (margin == 2) {
        return(matrix(rep_len(1, ncol(a)), nrow = 1, ncol = ncol(a)) %>% 
            setrownames_byname(rowtype(a)) %>% setcolnames_byname(colnames(a)) %>% 
            setrowtype(rowtype(a)) %>% setcoltype(coltype(a)))
    }
})(c(-10, -21, -12, -21), margin = c(1, 2))
 --- call from argument --- 
if (class(a) == "numeric" & length(a) == 1) {
    return(1)
}
 --- R stacktrace ---
where 1: (function (a, margin) 
{
    if (class(a) == "numeric" & length(a) == 1) {
        return(1)
    }
    if (!length(margin) %in% c(1, 2)) {
        stop("margin should have length 1 or 2 in fractionize_byname")
    }
    if (length(margin) == 2 && all(margin %in% c(1, 2))) {
        stopifnot(nrow(a) == ncol(a))
        return(diag(nrow(a)) %>% setrownames_byname(rownames(a)) %>% 
            setcolnames_byname(colnames(a)) %>% setrowtype(rowtype(a)) %>% 
            setcoltype(coltype(a)))
    }
    if (length(margin) != 1 || !(margin %in% c(1, 2))) {
        stop(paste("Unknown margin", margin, "in identize_byname. margin should be 1, 2, or c(1,2)."))
    }
    if (margin == 1) {
        return(matrix(rep_len(1, nrow(a)), nrow = nrow(a), ncol = 1) %>% 
            setrownames_byname(rownames(a)) %>% setcolnames_byname(coltype(a)) %>% 
            setrowtype(rowtype(a)) %>% setcoltype(coltype(a)))
    }
    if (margin == 2) {
        return(matrix(rep_len(1, ncol(a)), nrow = 1, ncol = ncol(a)) %>% 
            setrownames_byname(rowtype(a)) %>% setcolnames_byname(colnames(a)) %>% 
            setrowtype(rowtype(a)) %>% setcoltype(coltype(a)))
    }
})(c(-10, -21, -12, -21), margin = c(1, 2))
where 2: do.call(FUN, c(list(a), .FUNdots))
where 3: unaryapply_byname(identize_func, a = a, .FUNdots = list(margin = margin), 
    rowcoltypes = "none")
where 4: identize_byname(A)
where 5: organize_args(a, b, fill = 0, match_type = match_type)
where 6: binaryapply_byname(`-`, minuend, subtrahend)
where 7: difference_byname(identize_byname(A), A)
where 8: (function (a) 
{
    A <- complete_and_sort(a) %>% setrowtype(rowtype(a)) %>% 
        setcoltype(coltype(a))
    difference_byname(identize_byname(A), A)
})(c(-21, -12, -21, -10))
where 9: do.call(FUN, c(list(a), .FUNdots))
where 10: unaryapply_byname(iminus_func, a = a, rowcoltypes = "all")
where 11: Iminus_byname(m)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (a, margin) 
{
    if (class(a) == "numeric" & length(a) == 1) {
        return(1)
    }
    if (!length(margin) %in% c(1, 2)) {
        stop("margin should have length 1 or 2 in fractionize_byname")
    }
    if (length(margin) == 2 && all(margin %in% c(1, 2))) {
        stopifnot(nrow(a) == ncol(a))
        return(diag(nrow(a)) %>% setrownames_byname(rownames(a)) %>% 
            setcolnames_byname(colnames(a)) %>% setrowtype(rowtype(a)) %>% 
            setcoltype(coltype(a)))
    }
    if (length(margin) != 1 || !(margin %in% c(1, 2))) {
        stop(paste("Unknown margin", margin, "in identize_byname. margin should be 1, 2, or c(1,2)."))
    }
    if (margin == 1) {
        return(matrix(rep_len(1, nrow(a)), nrow = nrow(a), ncol = 1) %>% 
            setrownames_byname(rownames(a)) %>% setcolnames_byname(coltype(a)) %>% 
            setrowtype(rowtype(a)) %>% setcoltype(coltype(a)))
    }
    if (margin == 2) {
        return(matrix(rep_len(1, ncol(a)), nrow = 1, ncol = ncol(a)) %>% 
            setrownames_byname(rowtype(a)) %>% setcolnames_byname(colnames(a)) %>% 
            setrowtype(rowtype(a)) %>% setcoltype(coltype(a)))
    }
}
<bytecode: 0x55a7f826bb70>
<environment: 0x55a7f82724d8>
 --- function search by body ---
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1