[R-sig-Geo] predicting values from model function

2011-03-11 Thread Anna Gretschel
Dear List, I have fitted a spherical function to my variogram using variofit(...) from GeoR. Now I would like to predict some data with the function predict(object,...) from package stats. Does anyone know wether this works and if it does how to do it? Thanks a lot! Anna

[R-sig-Geo] replace values in spacetime (STFDF) object

2011-03-11 Thread Roth, M.
Hello, I want to replace specific values in a STFDF object from the spacetime package. As example consider the following stfdf object out of the vignette. sp = cbind(x = c(0,0,1), y = c(0,1,1)) row.names(sp) = paste(point, 1:nrow(sp), sep=) sp = SpatialPoints(sp) time = xts(1:4,

Re: [R-sig-Geo] Argument is of length 0 when extract values from a raster

2011-03-11 Thread Aman Verma
Hi Xin, Yes, I came across this exact problem. The bug has been fixed in the latest release (1.8-0), but it isn't fixed in the stable release (1.7-46). You can pick up the latest, by typing: install.packages(raster, repos=http://R-Forge.R-project.org;) But be sure to either unload the raster

Re: [R-sig-Geo] replace values in spacetime (STFDF) object

2011-03-11 Thread Aman Verma
Hi Martin, You put the brackets in the wrong place. You want to subset the dataframe, right, not the stfdf object, so: stfdf@data$values[1] - stfdf@data$values[1] + 1 would increase the value in the first row of the stfdf@data data frame. stfdf@data[,1] would get you the first column of the

Re: [R-sig-Geo] replace values in spacetime (STFDF) object

2011-03-11 Thread Roth, M.
Hi, thank you very much. But actually that is not exactly what I want to do. I want to select a specific time range and spatial points and manipulate the corresponding data. When I subset the dataframe I must do the selection manually and that is not that nice. Any idea how I could do this?

Re: [R-sig-Geo] replace values in spacetime (STFDF) object

2011-03-11 Thread Aman Verma
Hi Martin, Yeah, you can't replace values like that... here is a way to think about it. Consider: stfdf[,1] This returns a *completely new* spacetime object. You cannot set anything in this object because it has not been assigned to any variable. So, if you select stfdf[ , 1]@data$values

Re: [R-sig-Geo] replace values in spacetime (STFDF) object

2011-03-11 Thread Edzer Pebesma
What Martin wants, replacing a subset, is not possible for STFDF (or other ST*) objects, just as with Spatial* objects: library(sp) data(meuse) coordinates(meuse)=~x+y meuse[1, zinc] = 500 Error in meuse[1, zinc] = 500 : object of type 'S4' is not subsettable Indeed, as Aman suggests, this could