[R-sig-Geo] creating STFDF or ST objects in R

joke atuge jazzpriestess2000 at yahoo.com
Sun Jul 12 22:16:03 CEST 2015


Hello, This is in addition to my earlier message. Here's the sample codes oh how I tried to create the STFDF. DLF is a list of variables called "FRP"  for each polygon in the DL3 list. Timex is the time list for the spatial polygons list. 
DL7 <- sapply(1:length(DL3), function(i) {
  x <- DL3[[i]]
x$FRP <- DLF[[i]]
 x$datetime<-Timex[i]
 z<-Timex[i]
  p<-STIDF(x,data=x["FRP"],x$datetime,delta(x$datetime))
  p})

The error I get is: Error in augment.with.one(as.POSIXct(x)) : 
  cannot derive time interval from length 1 or constant sequence 
Kind regards,Ajoke

      On Sunday, July 12, 2015 6:08 PM, joke atuge <jazzpriestess2000 at yahoo.com> wrote:
   

 Hello,
 I am having serious issues creating a space time object with a list of spatialpolygonsdataframes and their dates/ time. I keep getting an error about the time not changing. How can I get this done please? Here's a sample of my data:

[[1]]
class       : SpatialPolygonsDataFrame 
features    : 128 
extent      : -127.44, -67.8964, 1.000039, 31.71804  (xmin, xmax, ymin,  ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
variables   : 1
names       : DDD.LFRP 
min values  :     16.6 
max values  :    488.5 

[[2]]
class       : SpatialPolygonsDataFrame 
features    : 126 
extent      : -129.04, -67.8964, 3.759985, 31.71804  (xmin, xmax, ymin,  ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
variables   : 1
names       : DDD.LFRP 
min values  :       14 
max values  :    335.2
The Time variables look like this:
Timex
 [1] "2008-12-01 04:00:00 GMT" "2008-12-01 06:30:00 GMT"

I have a list of 3,000 and the aim is to structure these spatialpolygons 
dataframe in such a way that I can have monthly aggregates.
 How do I create an STFDF or STIDF, please? I can convert to rasters and agregate but they are of varying extents and resolutions for each time.
Kind regards,
Ajoke


   
	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list