Displaying 2 results from an estimated 2 matches for "outer2".
Did you mean:
outer
2011 Jun 13
4
How to calculate the product of every two elements in two lists?
u<-c(0.1,0.2,0.3)
v<-c(0.2,0.3,0.5)
outer1<-outer(u,u,">=")
outer2<-outer(v,v,">=")
m<-nrow(outer1)
j<-nrow(outer2)
zz<-lapply(1:m, function(m) as.numeric(outer1[m,]))
tt<-lapply(1:m, function(m) as.numeric(outer2[m,]))
zz[[1]]*tt[[3]], e.g., is possible, but I want every products between two
lists.
Is there a way to do that?
--
View...
2005 Oct 31
1
[R] unvectorized option for outer()
...y outer() appropriately: one
> extra function
> >>> argument and an if-then-else clause to call mapply(FUN,
> ...) instead of
> >>> calling FUN directly.
> >>>
> >>> Here's a function demonstrating this:
> >>>
> >>> outer2 <- function (X, Y, FUN = "*", ..., VECTORIZED=TRUE)
> >>> {
> >>> no.nx <- is.null(nx <- dimnames(X <- as.array(X)))
> >>> dX <- dim(X)
> >>> no.ny <- is.null(ny <- dimnames(Y <- as.array(Y)))
> >>&g...