Re: [R] Problem looping a function to create/add to new dataframe

2011-09-15 Thread Michael L. Treglia
Thank you all- with your suggestions I was able to get this simulation to run- sorry, next time I'll post some reproduceable code- it had been a while since I posted, so I forgot about that. Best, Mike On 9/15/2011 1:40 PM, David Winsemius wrote: On Sep 15, 2011, at 1:50 PM, Mike Treglia wrot

Re: [R] Problem looping a function to create/add to new dataframe

2011-09-15 Thread David Winsemius
On Sep 15, 2011, at 1:50 PM, Mike Treglia wrote: Dear List Members, I have created a function to run a simulation based on a given set of values within a vector, such that I run the function like this: new.data<-sapply(vector, function) In which I run 'function' on every value within a ve

Re: [R] Problem looping a function to create/add to new dataframe

2011-09-15 Thread jim holtman
It would seem you want something like this: new.data <- sapply(seq(10, 100, 10), function(i) sapply(vector, yourFunc, i)) On Thu, Sep 15, 2011 at 1:50 PM, Mike Treglia wrote: > Dear List Members, > > I have created a function to run a simulation based on a given set of values > within a vector,

[R] Problem looping a function to create/add to new dataframe

2011-09-15 Thread Mike Treglia
Dear List Members, I have created a function to run a simulation based on a given set of values within a vector, such that I run the function like this: new.data<-sapply(vector, function) In which I run 'function' on every value within a vector that I created. The result is a matrix of 1000