Re: [R-sig-Geo] variance estimation (gstat, geoR, automap)

2009-02-24 Thread Paul Hiemstra
Hi Pilar, I think this list appropriate :). What would be a good idea is to get a book that describes kriging, some standard books are: Chilès, J. & Delfiner, P. Geostatistics: Modeling Spatial Uncertainty John Wiley & Sons, New York, 1999 Christensen, R. Plane Answers to Complex Questions: T

Re: [R-sig-Geo] Help to improve a code to substract two columns, delete and save shape-file

2009-02-24 Thread Paul Hiemstra
Ale, Some remarks between the lines: Alessandro schreef: Thanks for All help give me. I spoke with my professor and now I must do some changes. After subtract the column Z with clomun DEM_SGRD to obtain column H. I wish to create a new shape with only this H column. I tried and tried but w

Re: [R-sig-Geo] German Grid

2009-02-24 Thread Paul Hiemstra
Hi Jan, Even simpler, once you have a SpatialPolygons object you can use spsample() to make a grid in that polygon. For reading polygons look at the rgdal package or readShapePoly() in the maptools package. See http://spatial.nhh.no/R/etc/world_map_intro.html for a shapefile for the whole wor

Re: [R-sig-Geo] German Grid

2009-02-24 Thread Virgilio Gomez Rubio
Jan, If you have the boundaries of Germany and you want to make your own grid, you can use the overlay method to 'cut' the grid so that you only get the points inside Germany. You can use this object in gstat to make your predictions. Hope this helps, Virgilio El mar, 24-02-2009 a las 18:21 +0

[R-sig-Geo] stratified random sampling

2009-02-24 Thread Heuvelink, Gerard
Dear list, The stratified random sampling problem that I submitted a few days ago has already been solved, with the help of several of you, notably Edzer Pebesma. Edzer came up with the following solution: library(sp) library(rgdal) nc1 <- readShapePoly(system.file("shapes/sids.shp",package="

[R-sig-Geo] German Grid

2009-02-24 Thread Jan Hackenberg
Hello im doing a project with Interpolating ( Kriging ) Temperature Data from many Stations in Germany. To do a Kriging i have to use a Grid. So I have now 2 options. The better one is too download a prepared grid with the borders of Germany. Then the interpolated map will look great, because i hav

[R-sig-Geo] variance estimation (gstat, geoR, automap)

2009-02-24 Thread Pilar Tugores Ferra
Dear all, I'm trying to estimate the variance of a global abundance estimation computed by kriging interpolation and I am stuck. One can easily retrieve the variance at each prediction location (either using the package gstat, geoR or automap) using expressions similar to: >kriging_object$kri

Re: [R-sig-Geo] difficult to subtract two column of my shapefile

2009-02-24 Thread Robert Hijmans
indeed, on the example file, this works fine. library(foreign) data <- read.dbf('theme1.dbf') data$AminB <- data$A - data$B file.remove('theme1.dbf') write.dbf(data, 'theme1.dbf') if the dbf is too large you could you use a database to import the dbf, add the column, export again. Perhaps sqlite

Re: [R-sig-Geo] difficult to subtract two column of my shapefile

2009-02-24 Thread Jonathan Maynard
Hi, This should work: my_SPDF <- readShapeSpatial("theme1.shp") my_s...@data$ab<-my_s...@data$a-my_spdf@data$B writeSpatialShape(my_SPDF, "mynewfile") Cheers, Jonathan Maynard On Tue, Feb 24, 2009 at 6:37 AM, Alexander Brenning wrote: > Hi there, > > to throw in two more alternatives, there

Re: [R-sig-Geo] Iteratively Reweighted Generalized Least Squares IRWGLS

2009-02-24 Thread Edzer Pebesma
Faye Anderson wrote: > Hi All, > I think sgeostat function fit.variogram does it. > No, it does not quantify the correlations between variogram estimates, so you'd better forget about the "Generalized" -- just look at the output of variogram() that it reads; also the reweighting is only used w

Re: [R-sig-Geo] difficult to subtract two column of my shapefile

2009-02-24 Thread Alexander Brenning
Hi there, to throw in two more alternatives, there are functions read.dbf and write.dbf in packages shapefiles and foreign (see help files for examples; the functions differ between the two packages despite having the same name). Remember that operations on the shapefile attributes only affe

Re: [R-sig-Geo] Iteratively Reweighted Generalized Least Squares IRWGLS

2009-02-24 Thread Faye Anderson
Hi All, I think sgeostat function fit.variogram does it. Thanks. Faye ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo

[R-sig-Geo] R: substract two columns in a shapefile (but SAGA+R has an bug error)

2009-02-24 Thread Alessandro
Dear Prof. Bivand Tank for help I tried this cose library(rgdal) canopy_height <- readOGR(".", "theme1") canopy_height$ZDem.sgrd <- canopy_height$Z - canopy_height$Dem.sgrd writeOGR(canopy_height, ".", "canopy_height", driver="ESRI Shapefile") because maptool go out of memory, with rgdal the t

Re: [R-sig-Geo] Timezone boundaries (for adding to world map)?

2009-02-24 Thread Martin Maechler
> "RB" == Roger Bivand > on Fri, 20 Feb 2009 09:55:52 +0100 (CET) writes: RB> On Wed, 18 Feb 2009, Greg Snow wrote: >> There is a shapefile (works well with maptools and sp packages) with a >> world map and time zone information at: >> http://openmap.bbn.com/data/sha

Re: [R-sig-Geo] substract two columns in a shapefile (but SAGA+R has an bug error)

2009-02-24 Thread Roger Bivand
On Tue, 24 Feb 2009, Alessandro wrote: Dear Researcher, I have a shapefile with two columns "a" and "b" and I wish to subtract a-b to obtain a new column of difference. I tried in SAGA + R with the module "Table calculator for shapes". This worked without an error, but it didn't save the res

[R-sig-Geo] substract two columns in a shapefile (but SAGA+R has an bug error)

2009-02-24 Thread Alessandro
Dear Researcher, I have a shapefile with two columns "a" and "b" and I wish to subtract a-b to obtain a new column of difference. I tried in SAGA + R with the module "Table calculator for shapes". This worked without an error, but it didn't save the results either. I suspect that this is a bug

Re: [R-sig-Geo] cross validation gstat

2009-02-24 Thread ONKELINX, Thierry
Dear all, Im my opinion it makes sense to use repeated k-fold cross validation. The distribution of the statistics yields their confidence intervals. I will try that during the next few months on a dataset with about 2500 data points. The current plan is to repeat 1000 times a 10-fold cross val