spatial-ews / spatialwarnings

An R package to compute spatial early-warning signals of ecosystem degradation
Other
14 stars 4 forks source link

Coarse graining crashes R with subsize = 0 #44

Closed alexgenin closed 8 years ago

alexgenin commented 8 years ago

Add a check in coarse_grain() to catch this ? (or maybe do it at higher level to avoid exceptions in highly-repeated code).

SabihaMajumder commented 8 years ago

In the coarse graining code , we take average over the submatrix which includes dividing by the subsize. So you can not take subsize=0. If you want no coarse graining , take subsize =1. On 9 Feb 2016 22:26, "Alex Genin" notifications@github.com wrote:

Add a check in the coarse_grain to catch this ? (or maybe do it at higher level to avoid exceptions in highly-repeated code).

— Reply to this email directly or view it on GitHub https://github.com/fdschneider/spatial_warnings/issues/44.

alexgenin commented 8 years ago

Fixed in 8d46593dd9599de1c70c4433813c1287c7c99e7c