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

Julian Burgos julian at hafro.is
Mon May 7 14:56:38 CEST 2012


Thanks Julian, it was that the resolution of the shift was too small 
compared to the original raster.

On mán  7.maí 2012 12:27, Julian Zeidler wrote:
> 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
>>>>
>>>
>>>
>>
>>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>


-- 
Julian Mariano Burgos, PhD
Hafrannsóknastofnunin/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian at hafro.is



More information about the R-sig-Geo mailing list