Charles C. Berry writes:
> On Tue, 9 Dec 2008, tyler wrote:
>
> > I'm analyzing a large number of large simulation datasets, and I've
> > isolated one of the bottlenecks. Any help in speeding it up would be
> > appreciated.
>
> Cast the neighborhoods as an indicator matrix, then use matrix
Hello,
how about changing the last loop to an apply?
time.test2 <- function(dat) {
cen <- dat
grps <- 5
n.rich <- numeric(grps^2)
n.ind <- 1
for(i in 1:grps)
for (j in 1:grps) {
n.cen <- numeric(ncol(cen) - 2)
neighbours <- expand.grid(X=(j-1):(j+1), Y=(i-1):(i
On Tue, 9 Dec 2008, tyler wrote:
Hi,
I'm analyzing a large number of large simulation datasets, and I've
isolated one of the bottlenecks. Any help in speeding it up would be
appreciated.
Cast the neighborhoods as an indicator matrix, then use matrix
multiplications:
system.time(tmp <- t
3 matches
Mail list logo