[R] About "SpatioTemporal" Package

Elham Daadmehr e.daadmehr at yahoo.com
Wed Jul 13 12:29:49 CEST 2016


  Dear all,

 I want to build the data with the structure of STdata (using the
 function "createSTdata()"), I did as the following:

 ####
 datst=cbind(xy)
 yy=cbind(y,xx)
 ID=60101:60128
 date=as.numeric(1:13)
 y1=as.data.frame(t(cbind(yy)))
 datst1=as.data.frame(cbind(ID,datst))
 aa=as.Date(date,format = "%Y-%m-%d",origin = "2016-01-31")
 rownames(y1)<- aa
 colnames(y1)<- ID
 colnames(datst1)<-c("ID","x","y")
 ####

 But I don't know why the function "createSTdata(y1, datst1)" give me
 the following error:

 ####
 Error in stCheckClass(obs$ID, "character", name = "obs$ID") :
   obs$ID  must belong to one of class(es)  character
 In addition: Warning messages:
 1: In createSTdata(y1, datst1) :
   Unable to find column 'obs$obs', using 'obs[,1]
 2: In createSTdata(y1, datst1) :
   Unable to find column 'obs$date', using 'obs[,2]
 3: In createSTdata(y1, datst1) :
   Unable to find column 'obs$ID', using 'obs[,3]
 ####
 I checked the example data "mesa.data.raw", I found that my "ID" has
 the same type (integer) as the one in this data.


 Kindly thanks, in advanceElham


	[[alternative HTML version deleted]]



More information about the R-help mailing list