Re: [R-sig-Geo] Splancs and polymap

2012-03-30 Thread Raffaele Morelli
2012/3/29 Roger Bivand roger.biv...@nhh.no On Thu, 29 Mar 2012, Raffaele Morelli wrote: Hi, I am working on a simple kernel2d analisys and would like to create a polymap from a SpatialPolygonsDataFrame, let's stay US states. how can I accomplish this task? can you point me to the right

[R-sig-Geo] Spatial Join - over and weighted mean

2012-03-30 Thread Els Ducheyne
Dear R-SIG-GEO list I want to aggregate the mean value of points in a polygon using the over function. #Read the shapefile with the measurements shapefilename - paste(shapefiledir,shortNameIndicator,_,production.date,sep=) point.shapefile - readShapePoints(paste(shapefilename,.shp,sep=))

Re: [R-sig-Geo] Spatial Join - over and weighted mean

2012-03-30 Thread Edzer Pebesma
Els, what being weighted by what exactly? Any chance you can illustrate your problem by something we can reproduce? On 03/30/2012 01:58 PM, Els Ducheyne wrote: Dear R-SIG-GEO list I want to aggregate the mean value of points in a polygon using the over function. #Read the shapefile with

Re: [R-sig-Geo] Spatial Join - over and weighted mean

2012-03-30 Thread Els Ducheyne
Dear Edzer I have a point shapefile containing values of vaccination coverage (Z) estimated via a sample (SampleSize) The aim is to obtain a weighted mean of vaccination coverage per admin unit Below sample code studyzone - readShapePoly(paste(backgroundfilesdir,GDAM_studyzone.shp,sep=))

[R-sig-Geo] error writeRaster

2012-03-30 Thread Paulo Brando
Dear All, I'm getting an error when I try to write a raster to file. Please see more details below. This example works: r - raster(ncol=10, nrow=10) vals - 1:ncell(r) r - setValues(r, vals) writeRaster(r, filename=teste.tif) This one also works, using only one layer from MODIS temperature

Re: [R-sig-Geo] Spatial Join - over and weighted mean

2012-03-30 Thread Els Ducheyne
Dear Edze Thanks for your help Best regards On 30 Mar 2012, at 15:10, Edzer Pebesma wrote: On 03/30/2012 02:29 PM, Els Ducheyne wrote: Dear Edzer I have a point shapefile containing values of vaccination coverage (Z) estimated via a sample (SampleSize) The aim is to obtain a weighted

[R-sig-Geo] Closing readOGR handles

2012-03-30 Thread Alexander Shenkin
Hi folks, I'm opening some ESRI shapefiles with readOGR. R seems to keep open file handles on the files opened. Is there any way to close those handles without quitting R? I don't see a read-only option on readOGR, nor do I see any close methods. I've tried GDAL.close(x), but I get errors

[R-sig-Geo] Predict

2012-03-30 Thread Smit, M.J.
Dear list members, I want to do a scenario analysis: run a regression on the real data, then make some changes to that, and do a prediction based on the changed data. There is a predict command under sarlm for this, and it works. However, I have two questions. -

Re: [R-sig-Geo] Closing readOGR handles

2012-03-30 Thread Barry Rowlingson
On Fri, Mar 30, 2012 at 3:15 PM, Alexander Shenkin ashen...@ufl.edu wrote: Hi folks, I'm opening some ESRI shapefiles with readOGR.  R seems to keep open file handles on the files opened.  Is there any way to close those handles without quitting R?  I don't see a read-only option on readOGR,

Re: [R-sig-Geo] a world type mapping question

2012-03-30 Thread Jose M Molina
Hi R-Sig-Geo friends, I have climatic data sets generated with R, and As Erin, I also need to plot spatial attributes (e.g. monthly rainfall), but at a country-level. In addition, I need also to plot spatial variability (e.g. isolines of mean annual precipitation) in the specified country. I

Re: [R-sig-Geo] a world type mapping question

2012-03-30 Thread Hodgess, Erin
Did you look at the code for rworldmapExamples? I took that and modified the code and it worked great. thanks, Erin Erin M. Hodgess, PhD Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: hodge...@uhd.edu -Original Message-

Re: [R-sig-Geo] Closing readOGR handles

2012-03-30 Thread Alexander Shenkin
Hmm, I restarted R, and can't reproduce the issue. I'll post back if and when it happens again and I can narrow it down. I'm on Win 7 Pro x64, running R 2.14.2 and RStudio 0.95.263. I saw the open filehandles by doing a search in Process Explorer. packageDescription(rgdal) Package: rgdal

Re: [R-sig-Geo] a world type mapping question

2012-03-30 Thread Jose M Molina
Thanks Erin, I understand what you mean, and effectively, {rworldmap} example works great by modifying the code (e.g. by changing the argument value in 'nameDataColumn'). However, what I need is to choose a specific country (e.g. US), or region, plot in this country the location (long, lat)

Re: [R-sig-Geo] error writeRaster

2012-03-30 Thread Robert J. Hijmans
Paulo, The first error message is perhaps ambiguous, but the last one is very clear: No such file or directory. It suggests that either the path does not exist, or you are not allowed to write to it (from R). Error in .local(.Object, ...) : Dataset copy failed Error in file(filename, w) :

[R-sig-Geo] Change color of NA region in plotRGB?

2012-03-30 Thread Lyndon Estes
Dear List, I am trying to plot an RGB image using plotRGB, and I was wondering if there is anyway to turn the NA regions of the image to a different color (say white or grey)? For instance, in the following code, how to a turn the first and last 5 columns of the image something other than black?

[R-sig-Geo] upgrade plot

2012-03-30 Thread julio cesar oliveira
Hi members, I have rpanel with one rp.slider (package rpanel), and this call the function draw (See bellow) . This function draw plot one graph and one image. ## # EXAMPLE draw- function(panel) { par(mfrow=c(1,2)) plot(1:panel$Col, type = o)

Re: [R-sig-Geo] Change color of NA region in plotRGB?

2012-03-30 Thread Robert J. Hijmans
Lyndon, Here is a solution for your example: br2 - reclass(br, cbind(NA, 255)) plotRGB(br2, r = 1, g = 2, b = 3) But I have made a change in raster such that in future versions ( 1.9-77) you can set the background (NA) color like this: library(raster) b - brick(system.file(external/rlogo.grd,

Re: [R-sig-Geo] Change color of NA region in plotRGB?

2012-03-30 Thread Lyndon Estes
Hi Robert, Many thanks for your answer, much appreciated! Cheers, Lyndon On Fri, Mar 30, 2012 at 3:02 PM, Robert J. Hijmans r.hijm...@gmail.comwrote: Lyndon, Here is a solution for your example: br2 - reclass(br, cbind(NA, 255)) plotRGB(br2, r = 1, g = 2, b = 3) But I have made a