[R] Multiple calls to a function
Greg.Snow at intermountainmail.org
Wed Oct 31 20:33:05 CET 2007
Since you do not change anything in your call to the function, you could
just use the replicate function instead of the for loop (I don't know
that it will speed things up much, but it is a bit more readable).
Hope this helps,
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at intermountainmail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Keith Jones
> Sent: Wednesday, October 31, 2007 1:04 PM
> To: r-help at r-project.org
> Subject: [R] Multiple calls to a function
> Hi y'all,
> I wrote two functions; 1) sparsely samples a point pattern
> and calculates the Clark Evans R value and Z score, 2) calls
> the first function multiple times using a for loop and
> generates a histogram.
> I would like to know if there is a more efficient way of
> calling the first function other than using the for loop. Any ideas?
> for(i in 1:N) cel[i,]<-cezhpts(dat,np,cv)
> Keith Jones
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help