[R] data formatting: from rows to columns

2007-08-28 Thread Duncan Mackay
At 09:11 29/08/07 Jim Holtman wrote Here is a way using sprintf: x <- read.table(textConnection(" V2 V3 27 2032567 19 28 2035482 19 126 2472826 19 132 2473320 19 136 2035480 135 145 2062458 135 148 2074927 135 151 2102395 142 156 2027252 142 158 2473082 142")) # output the data ca

Re: [R] data formatting: from rows to columns

2007-08-28 Thread jim holtman
Here is a way using sprintf: x <- read.table(textConnection(" V2 V3 27 2032567 19 28 2035482 19 126 2472826 19 132 2473320 19 136 2035480 135 145 2062458 135 148 2074927 135 151 2102395 142 156 2027252 142 158 2473082 142")) # output the data cat(sprintf("%d\n%d\n\n", x$V2, x$V3),

Re: [R] data formatting: from rows to columns

2007-08-28 Thread James W. MacDonald
Hi Federico, Federico Calboli wrote: > Hi All, > > I have some data I need to write as a file from R to use in a different > program. > My data comes as a numeric matrix of n rows and 2 colums, I need to transform > each row as a two rows 1 col output, and separate the output of each row with

[R] data formatting: from rows to columns

2007-08-28 Thread Federico Calboli
Hi All, I have some data I need to write as a file from R to use in a different program. My data comes as a numeric matrix of n rows and 2 colums, I need to transform each row as a two rows 1 col output, and separate the output of each row with a blanck line. Foe instance I need to go from th