[R] Is there any function can perform "outer lapply" ?

Julian TszKin Chan cjulian at bu.edu
Tue Dec 7 05:24:30 CET 2010


I built my own "outer lapply " as attached code. Is there any R
build-in function can do the same jobs ?
Thanks


oapply<-function(X,Y,FUN, ..., MoreArgs = NULL, SIMPLIFY = TRUE,
USE.NAMES = TRUE){
	x=rep(X,each=length(X))
	y=rep(Y,times=length(Y))

	mapply(FUN,x,y, MoreArgs = MoreArgs, SIMPLIFY = SIMPLIFY,
       USE.NAMES = USE.NAMES)
}


Regards,
Julian



More information about the R-help mailing list