[R-sig-Geo] Image colours based on certain values

Michal Gallay mgallay01 at qub.ac.uk
Mon Sep 3 21:15:16 CEST 2007


Dear R Spatial Users,

I have many DEM ASCII grid files and have produced maps(images) via 
image(). The maps display e.g. slope angle, profile curvature for one area, 
but calculated via different methods.

I have searched R help, the R group, but I couldn't find out how to make R 
use certain colours for certain image values, in order to be able to 
compare the maps, for instance to have the same color for 0 curvature 
values, no matter what is the range of values.

If it helps, the following is applied in a 'for' loop for 20 files: 

raster.values <- read.asciigrid(fname=Files[i], as.image = FALSE,  
                          plot.image = FALSE, colname = Files[i])

min.val <- min(raster.values at data, na.rm=TRUE)
max.val <- max(raster.values at data, na.rm=TRUE)
 
image(raster.values, zlim=c(min.val,max.val), col=bpy.colors(255, 
cutoff.tails = 0.1), axes=TRUE)

I appreciate and thank you for help.

Michal

-- 
Michal Gallay

Postgraduate Research Student
School of Geography, Archaeology and Palaeoecology
Queen's University
Belfast BT7 1NN
Northern Ireland

Tel: +44(0)2890 273929
Fax: +44(0)2890 973212
email: mgallay01 at qub.ac.uk
www: www.qub.ac.uk/geog




More information about the R-sig-Geo mailing list