Thank you Agus,

Yes, it works.  I did not recognize that the raster has 2 "levels", 0 and
1, and the 1s were forest.  I put 2 colors and now I can display the forest
in the raster.

Best,

Manuel


2013/10/16 Agustin Lobo <alobolistas@gmail.com>

> Manuel,
> What do you mean by "it didn't work?
> You should have got an object named forest,
> post the same info as for cob_r
>
> Agus
>
> On Tue, Oct 15, 2013 at 6:49 PM, Manuel Spínola <mspinola10@gmail.com>
> wrote:
> > Dear list members,
> >
> > I have a raster with land use data (with values from 1 to 9).  I want to
> > select the cells with value 1 wich belong to forest.  How can I do that?
>  I
> > was trying:
> >
> > forest <- cob_r ==1
> > plot(forest)
> >
> > but it didn´t work
> >
> >> cob_r
> > class       : RasterLayer
> > dimensions  : 314, 236, 74104  (nrow, ncol, ncell)
> > resolution  : 300, 300  (x, y)
> > extent      : 447181, 517981, 1121851, 1216051  (xmin, xmax, ymin, ymax)
> > coord. ref. : +proj=tmerc +lat_0=0 +lon_0=-84 +k=0.9999 +x_0=500000
> +y_0=0
> > +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
> > data source : in memory
> > names       : layer
> > values      : 1, 9  (min, max)
> >
> > --
> > *Manuel Spínola, Ph.D.*
> > Instituto Internacional en Conservación y Manejo de Vida Silvestre
> > Universidad Nacional
> > Apartado 1350-3000
> > Heredia
> > COSTA RICA
> > mspinola@una.ac.cr
> > mspinola10@gmail.com
> > Teléfono: (506) 2277-3598
> > Fax: (506) 2237-7036
> > Personal website: Lobito de río <
> https://sites.google.com/site/lobitoderio/>
> > Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>
> >
> >         [[alternative HTML version deleted]]
> >
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>



-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola@una.ac.cr
mspinola10@gmail.com
Teléfono: (506) 2277-3598
Fax: (506) 2237-7036
Personal website: Lobito de río <https://sites.google.com/site/lobitoderio/>
Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/>

	[[alternative HTML version deleted]]

