Re: [R] Help with rep

2008-07-25 Thread Dimitris Rizopoulos
ttp://med.kuleuven.be/biostat/ http://perswww.kuleuven.be/dimitris_rizopoulos/ - Original Message - From: "Van Wyk, Jaap" <[EMAIL PROTECTED]> To: Sent: Friday, July 25, 2008 11:07 AM Subject: [R] Help with rep Hi Is it possible to use the rep command (or maybe some ot

Re: [R] Help with rep

2008-07-25 Thread Gabor Csardi
Jacob, yes, e.g. rep( c(4,3,4,2,3,4,1,2,3,4), 1 ) :) Seriously, your question reminds me of (rather silly) television contents, when one should find _the_ rule in a series of numbers. :) Here is a solution, assuming I've found the "correct" rule: unlist(lapply(4:1, seq, 4)) Best, Gabor On Fri

Re: [R] Help with rep

2008-07-25 Thread Peter Dalgaard
Van Wyk, Jaap wrote: Hi Is it possible to use the rep command (or maybe some other "shortcut") to create a vector with the following format: 4 3 4 2 3 4 1 2 3 4 I don't see a rep() solution, but > unlist(lapply(4:1, seq, to=4)) [1] 4 3 4 2 3 4 1 2 3 4 -- O__ Peter Dalgaa

[R] Help with rep

2008-07-25 Thread Van Wyk, Jaap
Hi Is it possible to use the rep command (or maybe some other "shortcut") to create a vector with the following format: 4 3 4 2 3 4 1 2 3 4 Any help is much appreciated. Thanks Jacob Jacob L van Wyk Department of Statistics University of Johannesburg, APK Box 524 Auckland Park 2006