Re: [R-sig-Geo] Making a raster from a shapefile using function rasterize with a categoric field

2012-05-26 Thread Manuel Spínola
Thank you very Mathieu. Best, Manuel 2012/5/24 Mathieu Rajerison > Hi, > > It surely is... > > You could transform lu$COB_AGROP as numeric like this: > lu$COB_AGROP_num <- as.numeric(as.factor(lu$COB_AGROP)) > > lur = rasterize(lu, crr, field = "COB_AGROP_num") > > Best, > > Mathieu > > 2012/

Re: [R-sig-Geo] Making a raster from a shapefile using function rasterize with a categoric field

2012-05-24 Thread Mathieu Rajerison
Hi, It surely is... You could transform lu$COB_AGROP as numeric like this: lu$COB_AGROP_num <- as.numeric(as.factor(lu$COB_AGROP)) lur = rasterize(lu, crr, field = "COB_AGROP_num") Best, Mathieu 2012/5/24 Manuel Spínola > Dear list members, > > I am trying to make a raster from a shapefile

[R-sig-Geo] Making a raster from a shapefile using function rasterize with a categoric field

2012-05-24 Thread Manuel Spínola
Dear list members, I am trying to make a raster from a shapefile that I imported to r using the function "readOGR". When I use the function rasterize and try to plot the object nothing is plotted. Is this happening because the field is categoric (factor) and not numeric? > cr = readOGR(dsn="/U