Re: [R] data.frame extracting data row-wise

2009-10-30 Thread Christian Lerch
Nice workaround :-). Thank you. Best, Christian Original-Nachricht > Datum: Fri, 30 Oct 2009 10:54:49 +0100 > Von: Karl Ove Hufthammer > An: r-h...@stat.math.ethz.ch > Betreff: Re: [R] data.frame extracting data row-wise > On Fri, 30 Oct 2009 10:42:12 +0100

Re: [R] data.frame extracting data row-wise

2009-10-30 Thread Karl Ove Hufthammer
On Fri, 30 Oct 2009 10:42:12 +0100 Christian Lerch wrote: > I am struggling with extracting data from a data frame: > x=data.frame(a=1:11,b=100:110) > > What I want is a list/vector in this sence: 1 100 2 101 3 102... y=t(as.matrix(x)) as.vector(y) Happy to help. -- Karl Ove Hufthammer

[R] data.frame extracting data row-wise

2009-10-30 Thread Christian Lerch
Dear All, I am struggling with extracting data from a data frame: x=data.frame(a=1:11,b=100:110) What I want is a list/vector in this sence: 1 100 2 101 3 102... For single rows, this works fine: as.matrix(x)[1,] For, say 2 rows, this works fine: z=c(as.matrix(x)[1,],as.matrix(x)[2,]) But z=c(