What is a good R equivalent of the GRASS function r.grow?

The closest I've been able to find is the script suggested by whuber in response to Creating randomly shaped clumps of cells in a raster from seeds of 1 cell/pixel?, which is written to address a different problem, so I'd like to know whether there are more efficient tools to simply grow outward uniformly.

  • Have you solved this? I have a feeling that you could use focal{raster} to do this... I'll give it some more thought.
    – si_2012
    Jun 3, 2014 at 8:28
  • Still haven't solved this. Best I can come up with so far is to somehow modify the code I linked to to remove randomness (not yet implemented, but seems doable). Jun 3, 2014 at 14:33

1 Answer 1


There is a workflow to fill in NA values by the nearest non-NA value in R here. You can easily set a maximum distance (in map units/meters).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.