[R-sig-Geo] [FORGED] Re: Error when I try to interpolate NA for each cell from Rasterstack

Rolf Turner r.turner at auckland.ac.nz
Sat Jan 14 20:47:57 CET 2017


On 15/01/17 05:11, Vijay Lulla wrote:
> I think this is because interpNA returns a matrix of one column whereas
> raster::setValues (used internally by calc) expects the values to be a
> vector of elements.  Changing the last line in `fun_interp` from
> `return(z)` to `return(c(z))` might do the trick.

<SNIP>

Better to use return(as.vector(z)).  See fortune(185).

cheers,

Rolf Turner

-- 
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-sig-Geo mailing list