[R] using list to pass argument to function

TyagiAnupam@aol.com TyagiAnupam at aol.com
Wed Nov 13 03:02:17 CET 2002


I am trying to apply *sapply* to functions within functions within functions 
to do a Monte Carlo experiment: take Y sample of size X based on cell 
probabilities (using Brian Ripley's suggestion for drawing from contingency 
tables), for each calculate a vector of statistics, calculate bootstrap std 
errs with R replications and their means and SD. Store results in a matrix 
for further use. The problem is how to pass 3 arguments returned as c() by a 
fucntion to another  function that uses them using: sapply(rep(c(), R), 
anotherfucntion). This does not seem to work, possibly because I am passing a 
c() argument where 3 separate arguemnts are needed. What is a good way to do 
this? I am trying to avoid *for* loops.

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list