[R-sig-Geo] Storing List data-types as Raster values

Lionel s6lihert at uni-bonn.de
Fri Sep 27 14:57:48 CEST 2013

Dear Shahab,

Indeed each raster cell should contain an unique value, I guess this is 
part of the definition of what a raster is. What you could do is put 
your different variable (id, direction) in different layer of a raster 
See ?stack for example.


On 09/27/2013 02:33 PM, shahab wrote:
> Hi,
> I am quite new to Raster library and a bit confused.
> Basically I would like to raster an area, and then place information
> (Identifuer, Direction) in each cell ,as follows:
>> myraster<-raster()
>>   myraster[1:3]<-list(id=c(1),direction=c(14,20))
> Error in min(vals) : invalid 'type' (list) of argument
> In addition: Warning message:
> In .replace(x, i = i, value = value, recycle = 1) :
>    number of items to replace is not a multiple of replacement length
> It seems to me that I can not put an object of type List,or vector,...in
> the cells??
> If this is the case, what would be the alternative solutions?
> /Shahab
> 	[[alternative HTML version deleted]]
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

More information about the R-sig-Geo mailing list