[R] How to make the "apply" faster

Debasish Pai Mazumder pai1981 at gmail.com
Sat Jul 9 22:19:27 CEST 2016


I have 4-dimension array x(lat,lon,time,var)

I am using "apply" to calculate over time
 new = apply(x,c(1,2,4),FUN=function(y) {length(which(y>=70))})

This is very slow. Is there anyway make it faster?

-Debasish

	[[alternative HTML version deleted]]



More information about the R-help mailing list