Re: [R] filling an array

2013-02-24 Thread Ista Zahn
Hi, The usual way is I <- rep(c(0, v), each=10) Best, Ista On Sat, Feb 23, 2013 at 10:56 PM, Jannetta Steyn wrote: > Hi All > > I'm just wondering if there is a quick way of filling a way with the > following. > > I want to declare array I with a specific length and then alternatively > fill

Re: [R] filling an array

2013-02-24 Thread Jannetta Steyn
Hi Josh and Jim Thanks for your help. With what you have given me I came up with v<-14 I<-c(rep(c(rep(0,10),rep(v,10)),10)) Which should give me more or less what I want. Many thanks Jannetta On 24 February 2013 04:13, Joshua Wiley wrote: > Hi Jannetta, > > Try this: > > rep(c(0, v), each =

Re: [R] filling an array

2013-02-23 Thread Joshua Wiley
Hi Jannetta, Try this: rep(c(0, v), each = 10) See ?rep for details Cheers, Josh On Sat, Feb 23, 2013 at 7:56 PM, Jannetta Steyn wrote: > Hi All > > I'm just wondering if there is a quick way of filling a way with the > following. > > I want to declare array I with a specific length and th

Re: [R] filling an array

2013-02-23 Thread Jim Lemon
On 02/24/2013 02:56 PM, Jannetta Steyn wrote: Hi All I'm just wondering if there is a quick way of filling a way with the following. I want to declare array I with a specific length and then alternatively fill it with 10 zeros and 10 specified values: v<- 14 I<- c(0,length(t)) But in stead o

[R] filling an array

2013-02-23 Thread Jannetta Steyn
Hi All I'm just wondering if there is a quick way of filling a way with the following. I want to declare array I with a specific length and then alternatively fill it with 10 zeros and 10 specified values: v<- 14 I <- c(0,length(t)) But in stead of just filling I with 0 I want 10 zeros and the