[R] How to combine matrix with sapply function?

Ben Bolker bolker at ufl.edu
Sat Nov 28 03:39:27 CET 2009


Peng Yu <pengyu.ut <at> gmail.com> writes:

> 
> I want an 'apply' function that can give me results by bind the result
> from each function call of g. Could somebody let me know how to do it?
> 
> g<-function(x){
  [snip]
> }
> 
> x=1:3
> 
> sapply(x,g) 

do.call(rbind,sapply(x,g))    ?




More information about the R-help mailing list