Re: [R-sig-Geo] Classify 106 netcdf's based on their spooled range

2013-05-27 Thread Robert J. Hijmans
Thiago, you could of course do mx <- max( cellStats(r, stat='max', na.rm=TRUE) ) but this is faster: mx <- maxValue(max(r)) for writing to ncdf you can use writeRaster (or a filename argument in cut, as long as the extension is ".nc". Robert On Mon, May 27, 2013 at 9:09 PM, Thiago V. dos San

[R-sig-Geo] Classify 106 netcdf's based on their spooled range

2013-05-27 Thread Thiago V. dos Santos
Dear all, I'm working on land use transition data that comes as netcdf. I would like to reclassify each one of these files in 15 classes, based on the min and max values of the entire series. Although I know this specific dataset ranges from 0 to 0.0680, I'd rather obtain it dinamically, via R

Re: [R-sig-Geo] Problem with extract {raster} function

2013-05-27 Thread Robert J. Hijmans
Manos, I think this happens because s1pol is invalid (self-intersecting). s2pol also has that problem but it works anyway. I have cleaned your shapefile and will send it to you via a separate email. With the cleaned shp file the problem does not occur. The script below shows the test for validity

Re: [R-sig-Geo] saga grid format TOPTOBOTTOM

2013-05-27 Thread Robert J. Hijmans
Chuck, raster can read both TOPTOBOTTOM=FALSE and TOPTOBOTTOM=TRUE SAGA files. However, it only writes TOPTOBOTTOM=TRUE. GDAL can read and write TOPTOBOTTOM=TRUE only. Apparently QGIS has a native driver for SAGA that can only do TOPTOBOTTOM=FALSE, which is odd (as it not the common approach).

Re: [R-sig-Geo] Problem Raster Overlay

2013-05-27 Thread Robert J. Hijmans
Mohgli, This should fix it: library(raster) r <- raster(FileNm) r <- rotate(r) Robert On Thu, May 23, 2013 at 3:55 PM, wrote: > Dear all > > I am plotting a raster dataset derived through a netCDF file and want to > overlay with a shapfile. Although I specify the extent of the raster > xmin=-1

Re: [R-sig-Geo] Kriging and datum shifts

2013-05-27 Thread Michael Sumner
For a simple approach I would just do on the raw coordinates in the SPDF. You could operate on the NetCDF file itself by reading from it directly as a matrix with vectors, but since you mention the SPDF why not just do this: x <- as.data.frame(spdf) ## figure out what "longitude" and "latitude" ar

Re: [R-sig-Geo] Issue when producing bubble plot (sp)

2013-05-27 Thread Thiago V. dos Santos
Thanks Edzer, that worked. Nothing better than receiving directions from the author. As usual, the real "issue" was the user.   Best, -- Thiago V. dos Santos PhD student Land and Atmospheric Science University of Minnesota http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/in

[R-sig-Geo] Kriging and datum shifts

2013-05-27 Thread Jeroen Steenbeek
Dear list, I am converting NetCDF data, placed on a global grid with irregular latitude values, to a regular WGS84 grid using IDW. It works, but I have one remaining issue for which I can use advice. The original data is oriented -280, +80 longitude, and it needs to be interpolated to -180,

Re: [R-sig-Geo] Issue when producing bubble plot (sp)

2013-05-27 Thread Edzer Pebesma
On 05/27/2013 03:06 PM, Thiago V. dos Santos wrote: > Dear R-siggers, > > I'm trying to produce a bubble plot using the sp package. The plot is ok, but > there are two issues I would like to improve. To see them, please reproduce > the code below: > >

[R-sig-Geo] Issue when producing bubble plot (sp)

2013-05-27 Thread Thiago V. dos Santos
 Dear R-siggers, I'm trying to produce a bubble plot using the sp package. The plot is ok, but there are two issues I would like to improve. To see them, please reproduce the code below: require(sp) require(rgdal) # Read PR shapefile download.file('htt