projects
/
valse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Pass R CMD check --as-cran
[valse.git]
/
pkg
/
R
/
util.R
diff --git
a/pkg/R/util.R
b/pkg/R/util.R
index
f8b01cc
..
ed10430
100644
(file)
--- a/
pkg/R/util.R
+++ b/
pkg/R/util.R
@@
-1,7
+1,5
@@
-#
...
+#
Compute the determinant of a matrix, which can be 1x1 (scalar)
gdet <- function(M)
{
- if (is.matrix(M))
- return (det(M))
- return (M[1]) #numeric, double
+ ifelse(is.matrix(M), det(M), M[1])
}