Am 09-12-2011 12:54, schrieb Sarah Goslee: >> myfunc<- function(x) {a=x; b=x-1; c(a, b) } >> ys<- sapply(1:5, myfunc) >> ys > [,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,]
Thank you very much! That is what I was looking for. Sorry that I have expressed myself so unclear.
Greetings Christof
______________________________________________ R-help@r-project.org 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.