Dears

Thanks a lot all of you for the suggestions. Jacob's suggestion seems more
logical, but Roman's suggestion is also fine.
Process suggested by Lyndon is OK, but there is no need of doing this if
max/min values can be extracted directaly.

With regards
Rahul Raj
Indian Institute of Remote Sensing, India



2011/3/1 Jacob van Etten <jacobvanetten@yahoo.com>

> Ideally, extract values using extractor functions only.
>
> In this case:
>
> minValue(r)
>
> Jacob.
>
> --- On Tue, 1/3/11, Roman Luštrik <roman.lustrik@gmail.com> wrote:
>
> > From: Roman Luštrik <roman.lustrik@gmail.com>
> > Subject: Re: [R-sig-Geo] Help on extracting min/max from raster object
> > To: "Rahul Raj" <rahulosho@gmail.com>
> > Cc: r-sig-geo@r-project.org
> > Date: Tuesday, 1 March, 2011, 14:18
>  > Doing it the non-pretty way is
> >
> > r@data@min
> > r@data@max
> >
> > (see str(r))
> >
> > Cheers,
> > Roman
> >
> >
> >
> > On Tue, Mar 1, 2011 at 1:22 PM, Rahul Raj <rahulosho@gmail.com>
> > wrote:
> >
> > > Dear All
> > >
> > > I have imported .img file in R using raster package
> > as
> > >
> > >  r <- raster(inputfile)
> > >
> > > Summary:
> > >
> > > > r
> > > class       : RasterLayer
> > > dimensions  : 1131, 1739, 1  (nrow, ncol,
> > nlayers)
> > > resolution  : 1000, 1000  (x, y)
> > > extent      : 535515, 2274515, 2003813,
> > 3134813  (xmin, xmax, ymin, ymax)
> > > projection  : +proj=aea +lat_1=28 +lat_2=12
> > +lat_0=20 +lon_0=78
> > > +x_0=2000000
> > > +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m
> > +no_defs +towgs84=0,0,0
> > > values      : H:\filename.img
> > > min value   :* 0.001407638 *
> > > max value   : 0.7978822
> > >
> > > I wanted to extract the min value and max value from
> > the object. How can I
> > > do this?
> > > I have used the following function for this purpose
> > > > cellStats(r,'min')
> > > [1] 0
> > >
> > > But it is returning 0, not "0.001407638"
> > >
> > > Kindly help me.
> > >
> > > With regards
> > > Rahul Raj
> > > Indian Institute of Remote Sensing, India
> > >
> > >        [[alternative HTML version
> > deleted]]
> > >
> > > _______________________________________________
> > > R-sig-Geo mailing list
> > > R-sig-Geo@r-project.org
> > > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> > >
> >
> >
> >
> > --
> > In God we trust, all others bring data.
> >
> >     [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
>
>
>

	[[alternative HTML version deleted]]

