[R-sig-Geo] problem with expand function (raster package)

Julian Zeidler rlist at zeidlers.de
Mon May 7 14:27:20 CEST 2012


Hi Julian,

Your input raster myraster does not change! Have a look at your output 
raster eff. Also your "shift" is to small compared to your Raster 
Resolution to result in "extended data"

Try:

ex <- extent(myraster)+100
eff <- expand(myraster, ex)
extent(eff)

Best,
Julian




Am 07.05.2012 13:49, schrieb Julian Burgos:
> Apologies again, this was the right list.  I need more coffee.
>
> On mán  7.maí 2012 11:47, Julian Burgos wrote:
>> Sorry, posted to the wrong list.
>>
>> On mán  7.maí 2012 11:44, Julian Burgos wrote:
>>> Dear list,
>>>
>>> I cannot figure this out.  I am trying to extend a raster object, 
>>> using the "extend" function (from the raster package), but the 
>>> extension of the raster does not change.  Here is an example:
>>>
>>> ##############################
>>> set.seed(100)
>>> myraster <- raster(ncols=4, nrows=4)
>>> myraster[] <-  sample(1:10,ncell(eff),replace=T)
>>> extent(myraster)
>>>
>>> ex <- extent(myraster)+2
>>> eff <- expand(myraster, ex)
>>> extent(myraster)
>>> ##############################
>>>
>>> As you can see, the extent of "myraster" does not change.   What I 
>>> am doing wrong?
>>> Many thanks,
>>>
>>> Julian
>>>
>>
>>
>
>



More information about the R-sig-Geo mailing list