Dear list members,

I am using the function projectRaster (package: Raster) to project a
raster, but the result is a projected raster (what I want) but with the
values from the raster used as input:

> bio3cr <- crop(bio3, cr)> bio3crmask =  rasterize(cr, bio3cr)Found 1 region(s) and 1 polygon(s)> bio3res = mask(bio3cr, bio3crmask)> plot(bio3res)> bio3resclass       : RasterLayer
dimensions  : 382, 407, 155474  (nrow, ncol, ncell)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : -85.95, -82.55833, 8.041667, 11.225  (xmin, xmax, ymin, ymax)
coord. ref. : NA
values      : in memory
min value   : 70
max value   : 85


> class(bio3crmask)[1] "RasterLayer"
attr(,"package")
[1] "raster"> bio3crmaskclass       : RasterLayer
dimensions  : 382, 407, 155474  (nrow, ncol, ncell)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : -85.95, -82.55833, 8.041667, 11.225  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
values      : in memory
min value   : 1
max value   : 1
> newproj <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"> bio3res <- projectRaster (bio3crmask, crs=newproj)> bio3resclass       : RasterLayer
dimensions  : 391, 417, 163047  (nrow, ncol, ncell)
resolution  : 0.00833, 0.00833  (x, y)
extent      : -85.99165, -82.51804, 8.00962, 11.26665  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
values      : in memory
min value   : 1
max value   : 1



What I need to do to keep the values of the raster that I want to project?

Best,

Manuel

-- 
*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]]

