Niels Richard Hansen wrote:
Consider the following little "benchmark"
> require(Matrix)
> tmp <- Matrix(c(rep(1,1000),rep(0,9000)),ncol=1)
> ind <- sample(1:1,1)
> system.time(tmp[ind,])
user system elapsed
0.004 0.001 0.005
> ind <- sample(1:1000,1,replace=TRUE)
> s
Consider the following little "benchmark"
> require(Matrix)
> tmp <- Matrix(c(rep(1,1000),rep(0,9000)),ncol=1)
> ind <- sample(1:1,1)
> system.time(tmp[ind,])
user system elapsed
0.004 0.001 0.005
> ind <- sample(1:1000,1,replace=TRUE)
> system.time(tmp[ind,])
user syst
2 matches
Mail list logo