Re: [R] Edges and Rasters

2012-06-22 Thread Sarah Goslee
There's almost certainly a more elegant way to do it, but this works: r <- raster(nrow=30, ncol=30, xmn=0) r[]<-NA r[393:409]<-99 r[423:439]<-99 r[453:455]<-99 r[456:460]<-30 r[461:469]<-99 r[483:499]<-99 r[513:529]<-99 plot(r,col=terrain.colors(100)) plot(edge(r, type="outer"), col=c("transparen

Re: [R] Edges and Rasters

2012-06-21 Thread riodementa
Lot of thanks Sarah! It works!, and sorry for don`t say that I'm using Windows7. And i have another question. Do you know if it is possible to plot the edge using 2 or more cells? What I'm trying to do is an edge wider, and i don'care lose some of the information inside or outside around the edge.

Re: [R] Edges and Rasters

2012-06-20 Thread Sarah Goslee
Here's one way to do it, preserving your original approach as much as possible. (Note: I'm not sure how well "transparent" is supported on other devices or OSs [I'm using Cairo on Linux], but since you don't say what you're using it's impossible to provide a definite solution.) plot(r,col=terrain.

[R] Edges and Rasters

2012-06-20 Thread riodementa
Hi everyone! I would like to draw a line surrounding my raster, with i want it in black, and i don't know if its possible to change the colour. A simple example is: r <- raster(nrow=30, ncol=30, xmn=0) r[]<-NA r[393:409]<-99 r[423:439]<-99 r[453:455]<-99 r[456:460]<-30 r[461:469]<-99 r[483:499]