Hi,

a have some code like

myfunc <- function(x) { ...;  return c(a,b) }

ys <- sapply(0:100,myfunc)

so I get something like c(c(a1,b1),c(a2,b2),...)

But now I need the "as" and "bs" in one vector

as <- apply(ys, function(c(a,b)) a)
bs <- apply(ys, function(c(a,b)) b)

Can you help me with the correct syntax, instead of my pseudo code?

thx
Christof

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to