Skip to content
Prev 279856 / 398506 Next

apply on function with vector as result

This would be a whole lot easier if we had a reproducible example,
or at least knew what your output data actually looked like, and an
example of what you *wanted* it to look like.

For instance, I'm confused by your description of your output data:
[1] 1 2 3 4

c(c(), c()) is a single vector already.

But when I try an approximation of your non-reproduclble example, that's
not what I get anyway. I get the expected matrix:
[,1] [,2] [,3] [,4] [,5]
[1,]    1    2    3    4    5
[2,]    0    1    2    3    4

And from there, it's not at all clear what you mean by "one vector" -
in what order? All of the a then all of the b values? abab?

as.vector(ys) and as.vector(t(ys)) will accomplish those.

Or do you mean simply
as <- ys[1,]
bs <- ys[2,]

But all this is academic since I don't know what your data look like, really.

Sarah
On Fri, Dec 9, 2011 at 6:40 AM, Christof Klu? <ckluss at email.uni-kiel.de> wrote: