RE: [R] beginner programming question

2003-12-22 Thread Adrian Dusa
] Sent: Thursday, December 18, 2003 5:53 PM To: Tony Plate Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [R] beginner programming question On Wed, 17 Dec 2003, Tony Plate wrote: Another way to approach this is to first massage the data into a more regular format. This may or may

Re: [R] beginner programming question

2003-12-18 Thread Thomas Lumley
On Wed, 17 Dec 2003, Tony Plate wrote: Another way to approach this is to first massage the data into a more regular format. This may or may not be simpler or faster than other solutions suggested. You could also use the reshape() command to do the massaging -thomas x -

[R] beginner programming question

2003-12-17 Thread Adrian Dusa
Hi all, The last e-mails about beginners gave me the courage to post a question; from a beginner's perspective, there are a lot of questions that I'm tempted to ask. But I'm trying to find the answers either in the documentation, either in the about 15 free books I have, either in the help

RE: [R] beginner programming question

2003-12-17 Thread Gabor Grothendieck
( unlist( apply( z, 1, f ) ), 2) ) --- Date: Wed, 17 Dec 2003 21:28:05 +0200 From: Adrian Dusa [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [R] beginner programming question Hi all, The last e-mails about beginners gave me the courage to post a question; from a beginner's perspective

RE: [R] beginner programming question

2003-12-17 Thread Ray Brownrigg
From: Gabor Grothendieck [EMAIL PROTECTED] Date: Wed, 17 Dec 2003 15:02:49 -0500 (EST) Define function f to take a vector as input representing a single input row. f should (1) transform this to a vector representing the required row of output or else (2) produce NULL if no row is to

RE: [R] beginner programming question

2003-12-17 Thread Gabor Grothendieck
the first two advantages listed. --- Date: Thu, 18 Dec 2003 10:04:52 +1300 (NZDT) From: Ray Brownrigg [EMAIL PROTECTED] To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [R] beginner programming question From: Gabor Grothendieck [EMAIL PROTECTED] Date: Wed, 17 Dec

Re: [R] beginner programming question

2003-12-17 Thread Tony Plate
Another way to approach this is to first massage the data into a more regular format. This may or may not be simpler or faster than other solutions suggested. x - read.table(clipboard, header=T) x rel1 rel2 rel3 age0 age1 age2 age3 sex0 sex1 sex2 sex3 113 NA 25 232 NA

Re: [R] beginner programming question

2003-12-17 Thread Peter Dalgaard
Tony Plate [EMAIL PROTECTED] writes: xx - rbind(colnames-(x[,c(rel1,age0,age1,sex0,sex1)], nn), + colnames-(x[,c(rel2,age0,age2,sex0,sex2)], nn), + colnames-(x[,c(rel3,age0,age3,sex0,sex3)], nn)) PS. To advanced R users: Is the above usage of the colnames- function within an

Re: [R] beginner programming question

2003-12-17 Thread Tony Plate
Thanks. As a follow-up question, is it considered acceptable programming practice for - functions to modify their x argument? -- Tony Plate At Thursday 12:23 AM 12/18/2003 +0100, Peter Dalgaard wrote: Tony Plate [EMAIL PROTECTED] writes: xx -