[mailto:[EMAIL PROTECTED] On Behalf Of Greg Snow
> Sent: Thursday, January 24, 2008 1:33 PM
> To: David Afshartous; r-help@r-project.org
> Subject: Re: [R] Alternating numbers in rep()
>
> Here are a couple of options (I'm sure there are plenty of
> others) that replicate your
[EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of David Afshartous
> Sent: Thursday, January 24, 2008 1:03 PM
> To: r-help@r-project.org
> Subject: [R] Alternating numbers in rep()
>
>
> All,
>
> I'm trying to obtain a one-liner to generate a certain
On Thu, Jan 24, 2008 at 03:03:22PM -0500, David Afshartous wrote:
>
> All,
>
> I'm trying to obtain a one-liner to generate a certain sequence of
> alternatign numbers.
>
> Consider:
> > unlist(rep(list(c(1,2), c(3,4)), each = 6))
> [1] 1 2 1 2 1 2 1 2 1 2 1 2 3 4 3 4 3 4 3 4 3 4 3 4
>
> I'd l
This ??
as.vector( outer(0:1, rep(seq(1,37,by=2), each=6), "+" ) )
On Thu, 24 Jan 2008, David Afshartous wrote:
>
> All,
>
> I'm trying to obtain a one-liner to generate a certain sequence of
> alternatign numbers.
>
> Consider:
>> unlist(rep(list(c(1,2), c(3,4)), each = 6))
> [1] 1 2 1 2
All,
I'm trying to obtain a one-liner to generate a certain sequence of
alternatign numbers.
Consider:
> unlist(rep(list(c(1,2), c(3,4)), each = 6))
[1] 1 2 1 2 1 2 1 2 1 2 1 2 3 4 3 4 3 4 3 4 3 4 3 4
I'd like the result to be as above but continue until 38. Of course, I
could hardcode this g
5 matches
Mail list logo