[R-sig-Geo] R_code

Hari Sharma himalayanhari at gmail.com
Sun Jul 2 18:02:42 CEST 2017


Hi
I want to reproject raster layer and want to mask the projected raster under mask file. However, I got problem. Could you please help me to fix this problem:

crs_84 <- CRS("+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs")
crs_change <- CRS("+proj=tmerc +lat_0=0 +lon_0=84 +k=0.9999 +x_0=500000 +y_0=0 +a=6377276.345 +b=6356075.41314024 +units=m +no_defs")
template1000 <- raster(xmn = 95742.4, xmx = 936885.22, ymn = 2901798.01, ymx = 3391155.19, resolution = 1000, crs = crs_change)
layer_01_p_1000 <- projectRaster(from = layer_01, to = template1000) ####upto this its fine.
layer_01_p_1000_m <- mask(x = layer_01_p_1000, mask = maskfile, updatevalue = NA)  ###when I run this I got following error.

Error in mask(x = layer_01_p_1000, mask = maskfile, updatevalue = NA) : 
 unused arguments (x = layer_01_p_1000, mask = maskfile, updatevalue = NA)


I am looking forward from your response.

Harry


More information about the R-sig-Geo mailing list