Skip to content

Commit

Permalink
clarify vapply call for checking matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebaron committed May 17, 2022
1 parent 862d36f commit ba2a86a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/class_matlist.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ valid.matlist <- function(object) {

x3 <- (!any(duplicated(labels))) | length(labels)==0

x4 <- all(vapply(object@data, det, 1.23)>=0)
x4 <- all(vapply(object@data, FUN = det, FUN.VALUE = 1.23) >= 0)

x5 <- mapply(object@data, object@labels, FUN=function(x,y) {
nrow(x) == length(y)
Expand All @@ -48,7 +48,7 @@ valid.matlist <- function(object) {
}

if(!x4) {
y <- which(!vapply(object@data, det, 1.23) > 0)
y <- which(!vapply(object@data, FUN = det, FUN.VALUE = 1.23) >= 0)
message("Problem with this matrix:")
print(object@data[y])
out <- c(out, "Invalid matrix: determinant is less than 0.")
Expand Down

0 comments on commit ba2a86a

Please sign in to comment.