Re: [R] Managing output

2009-08-26 Thread Don MacQueen
See minor comment below -Don At 8:07 PM + 8/26/09, Oliver Bandel wrote: <- first part of email omitted -> < For many entries, it would be faster, if you just allocate the array that should be written, by just writing 0 into it, or empty strings or something like this... mydat[1:100] <-

Re: [R] Managing output

2009-08-26 Thread Phil Spector
trying to do? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noah Silverman Sent: Wednesday, August 26, 2009 2:20 PM To: r help Subject: [R] Managing output Hi, Is there a way to build up a vector, item by item. In per

Re: [R] Managing output

2009-08-26 Thread Rolf Turner
t; loop construct can be avoided so you don't have to think about messy indexing. What exactly are you trying to do? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noah Silverman Sent: Wednesday, August 26, 2009 2:20 PM To: r

Re: [R] Managing output

2009-08-26 Thread Noah Silverman
d tasks, the >>> apply/sapply/lapply/mapply family of functions? >>> >>> In general, the "for" loop construct can be avoided so you don't >>> have to think about messy indexing. What exactly are you trying to do? >>> >>> -Orig

Re: [R] Managing output

2009-08-26 Thread Oliver Bandel
Oliver Bandel first.in-berlin.de> writes: [...] > For many entries, it would be faster, if you just allocate > the array that should be written, by just writing 0 into it, > or empty strings or something like this... > > mydat[1:100] <- 0 > > mydat > [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Re: [R] Managing output

2009-08-26 Thread Duncan Murdoch
On 26/08/2009 4:06 PM, Rolf Turner wrote: On 27/08/2009, at 8:00 AM, Duncan Murdoch wrote: On 26/08/2009 3:20 PM, Noah Silverman wrote: Hi, Is there a way to build up a vector, item by item. In perl, we can "push" an item onto an array. How can we can do this in R? I have a loop that gener

Re: [R] Managing output

2009-08-26 Thread Oliver Bandel
Noah Silverman smartmediacorp.com> writes: > > Hi, > > Is there a way to build up a vector, item by item. In perl, we can > "push" an item onto an array. How can we can do this in R? > I have a loop that generates values as it goes. I want to end up with a > vector of all the loop results.

Re: [R] Managing output

2009-08-26 Thread Rolf Turner
On 27/08/2009, at 8:00 AM, Duncan Murdoch wrote: On 26/08/2009 3:20 PM, Noah Silverman wrote: Hi, Is there a way to build up a vector, item by item. In perl, we can "push" an item onto an array. How can we can do this in R? I have a loop that generates values as it goes. I want to end up

Re: [R] Managing output

2009-08-26 Thread Duncan Murdoch
On 26/08/2009 3:20 PM, Noah Silverman wrote: Hi, Is there a way to build up a vector, item by item. In perl, we can "push" an item onto an array. How can we can do this in R? I have a loop that generates values as it goes. I want to end up with a vector of all the loop results. In perl i

Re: [R] Managing output

2009-08-26 Thread Noah Silverman
n...@r-project.org] On > Behalf Of Noah Silverman > Sent: Wednesday, August 26, 2009 2:20 PM > To: r help > Subject: [R] Managing output > > Hi, > > > Is there a way to build up a vector, item by item. In perl, we can > "push" an item onto an array. How can we

Re: [R] Managing output

2009-08-26 Thread Erik Iverson
tly are you trying to do? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noah Silverman Sent: Wednesday, August 26, 2009 2:20 PM To: r help Subject: [R] Managing output Hi, Is there a way to build up a vector, item by item

[R] Managing output

2009-08-26 Thread Noah Silverman
Hi, Is there a way to build up a vector, item by item. In perl, we can "push" an item onto an array. How can we can do this in R? I have a loop that generates values as it goes. I want to end up with a vector of all the loop results. In perl it woud be: for(item in list){ result <- 2