Thank you very much Edzer.  That works.

Manuel


2014-03-23 13:35 GMT-06:00 Edzer Pebesma <edzer.pebesma@uni-muenster.de>:

> require(raster)
> r = raster()
> r[] = rnorm(180*360)
> plot((r-cellStats(r,"min"))/(cellStats(r,"max")-cellStats(r,"min")))
>
> raster::scale, like base::scale, centers to mean zero and scales to unit
> variance.
>
> On 03/23/2014 06:40 PM, Manuel Spínola wrote:
> > Dear list members,
> >
> > I want to rescale a raster between 0 and 1, how can I do that in R?
> >
> > I know that there is a scale function in the raster package, but I don´t
> > know how to use it for rescaling.
> >
> > Best,
> >
> > Manuel
> >
> >
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
> --
> Edzer Pebesma
> Institute for Geoinformatics (ifgi), University of Münster
> Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
> 83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795
>
>
> _______________________________________________
> 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]]

