Re: [R-sig-Geo] plotting of large raster dataset fails

2011-03-29 Thread Etienne Bellemare
Etienne, Maybe you could give it a try with raster library as it is can read from disc instead of loading in memory the whole image. library(raster) r2=raster(img/TM.burnpix.pnsc.2000-2006.freq.tif) plot(r2) Etienne (B. Racine) On Mon, Mar 28, 2011 at 9:47 PM, Etienne etienne...@yahoo.com

Re: [R-sig-Geo] Raster calculation

2011-03-23 Thread Etienne Bellemare
Brad, If you have a raster with your single band, you could try something like: install.packages(raster, rgdal) library(raster) # load raster r - raster(band_7.tif) # (otherwise, use brick() instead of raster(), so you can pick your layer) flare - which(r[] 99) p - xyFromCell(r, flare,

[R-sig-Geo] extract cell numbers from raster along a line

2011-03-18 Thread Etienne Bellemare
I'd like to extract celle numbers from a raster using a line, but it seems the cellnumbers=TRUE option isn't working with lines in raster::extract. simple example : library(raster) r - raster(matrix(1:20, nrow=4)) l - SpatialLines(list(Lines(list(Line(list(x=c(0, 1), y=c(0, 1, ID=1))) #

Re: [R-sig-Geo] extract cell numbers from raster along a line

2011-03-18 Thread Etienne Bellemare
It is not working because cellnumbers is currently only an argument for extracting values from a Raster* for polygons. That's what the docs say. But I'll also implement if for lines. I did notice that, but there was no ==line== section in the doc I have. Is my package outdated ? In your

Re: [R-sig-Geo] Variable window on a raster

2011-03-16 Thread Etienne Bellemare
Thanks Robert, that's exactly the hack I needed. Etienne On Sun, Mar 13, 2011 at 7:48 PM, Robert Hijmans r.hijm...@gmail.com wrote: Etienne, What you are doing makes sense to me. To avoid border problems, perhaps you can first 'expand' the input raster by adding sufficient rows and columns

Re: [R-sig-Geo] Open raster _ extract pixel value

2011-03-13 Thread Etienne Bellemare
Komine, You're passing a path to crop, but you should pass your raster object. (see ?crop) Try : library(raster) myobject - raster(C:\\Users\\komine\\Desktop\\MODIS\\MYD09GQ.A2010280.h16v07.005.2010282160347.sur_refl_b01_1.tif) e - extent(-90, -32, -60, 15) r - crop(myobject,e) plot(r) Etienne

[R-sig-Geo] Variable window on a raster

2011-03-09 Thread Etienne Bellemare
Hi list, I'd like to vary the size of my window on a moving window filter. The size of the radius is set by a function of the center pixel (the current pixel processed). I picked the raster package, but as focal() is using a fix radius for the analysis, I thought I could use a large radius and

Re: [R-sig-Geo] Plot Histogram with axes inverted

2011-02-03 Thread Etienne Bellemare
Package gglot2::coord_flip() could be of help. Etienne 2011/2/1 ldec...@comcast.net i'd suggest using table() to generate the frequencies then displaying as a barplot(..., horiz = T) . Lee De Cola, PhD, MCP. DATA to Insight ldec...@comcast.net Reston, Virginia 571 315 0577