Re: [R] one long column of data - three small columns

2009-11-04 Thread MORNEAU François
long column of data - three small columns say i have a column of data like this... 2 3 4 2 1 6 6 4 7 and i want it in three columns like this 226 314 467 ...so i can make a contour plot. How do i do this? -- View this message in context: http://old.nabble.com/one-long-column-of-data--%3E

Re: [R] one long column of data - three small columns

2009-11-03 Thread Peter Alspach
] On Behalf Of frenchcr Sent: Wednesday, 4 November 2009 8:06 a.m. To: r-help@r-project.org Subject: [R] one long column of data - three small columns say i have a column of data like this... 2 3 4 2 1 6 6 4 7 and i want it in three columns like this 226 314 467 ...so i can make

Re: [R] one long column of data - three small columns

2009-11-03 Thread Jorge Ivan Velez
Hi french, Here is a suggestion: x - c(2, 3, 4, 2, 1, 6, 6, 4, 7) matrix(x, ncol = 3) # [,1] [,2] [,3] # [1,]226 # [2,]314 # [3,]467 with x the column of data you have. HTH, Jorge On Tue, Nov 3, 2009 at 2:05 PM, frenchcr wrote: say i have a column

Re: [R] one long column of data - three small columns

2009-11-03 Thread frenchcr
frenchcr wrote: say i have a column of data like this... 2 3 4 2 1 6 6 4 7 and i want it in three columns like this 226 314 467 ...so i can make a contour plot. How do i do this? ok, so matrix(x, 3, 3) works. what if i have a b c a c a c and want a b c a

[R] one long column of data - three small columns

2009-11-03 Thread frenchcr
say i have a column of data like this... 2 3 4 2 1 6 6 4 7 and i want it in three columns like this 226 314 467 ...so i can make a contour plot. How do i do this? -- View this message in context:

Re: [R] one long column of data - three small columns

2009-11-03 Thread Jorge Ivan Velez
Hi french, Here is a suggestion: x - c(2, 3, 4, 2, 1, 6, 6, 4, 7) matrix(x, ncol = 3) # [,1] [,2] [,3] # [1,]226 # [2,]314 # [3,]467 HTH, Jorge On Tue, Nov 3, 2009 at 2:05 PM, frenchcr wrote: say i have a column of data like this... 2 3 4 2 1

Re: [R] one long column of data - three small columns

2009-11-03 Thread Patrick Connolly
On Tue, 03-Nov-2009 at 12:26PM -0800, frenchcr wrote: | How do i do this? | | | ok, so matrix(x, 3, 3) works. | | what if i have | | a | b | c | a | c | a | c | | and want | | a b c | a c | a c | | ?? Hint 1: A matrix can use characters or numerics Hint 2: can be considered as a