Displaying 1 result from an estimated 1 matches for "ntyp".
Did you mean:
ntp
2012 Feb 27
0
Conflict from saved implicit generics in methods package for rcond, norm, backsolve
...t; norm(x1, "M")
[1] 10
normR> stopifnot(all.equal(norm(x1, "F"),
norm+ sqrt(sum(x1^2))))
normR> hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
normR> h9 <- hilbert(9)
normR> ## all 4 types of norm:
normR> (nTyp <- eval(formals(base::norm)$type))
[1] "O" "I" "F" "M"
normR> sapply(nTyp, norm, x=h9)
O I F M
2.828968 2.828968 1.755872 1.000000
R> setGeneric("norm")
[1] "norm"
R> example(norm)
normR> (x1 &...