[R-sig-Geo] Error with KED with 2 external drift factors, one iterating in time

Edzer Pebesma edzer.pebesma at uni-muenster.de
Fri Nov 27 08:47:29 CET 2009



Tobin Cara wrote:
> Hello,
>
> I am trying to krige temperature relative to an elevation and a forecast grid. The forecast changes hourly.
>
> Everything reads in well until I use the kriging command:
>
> list_ked[[i]] <- krige(Temp00[,i]~Z+COS7, locations=DataCoordhr, newdata=elev, model = fitted_vario)
>   
use

list_ked[[i]] <- krige(Temp00[,i]~Z+COS7, DataCoordhr, elev, fitted_vario)

and make sure that DataCoordhr is of class SpatialPointsDataFrame, e.g. by doing a
coordinates(DataCoordhr) <- ~x+y

or sth like that.


> Error in function (classes, fdef, mtable)  :
>   unable to find an inherited method for function "krige", for signature "formula", "data.frame"
>   
>> trace()
>>     
> Error in methods::.TraceWithMethods(where = <environment>) :
>   element 1 is empty;
>    the part of the args list of 'is.function' being evaluated was:
>    (what)
>
>
>
> I have linked my data coordinates with both Z and COS7 and I have linked two ascii grids elev and COS7 with the following commands:
>
>
>
> COS700 <- read.table("D:\\Krigging R\\COSMO7Temp2000\\COS7_Val_Temp_00_trans.txt")
> COS7hr <- COS700[,i]
>
> DataCoord <- read.delim("TempANZCoord_Elev_Val00.txt")
> DataCoord <- as.matrix(DataCoord)  ## transform into a matrix
> DataCoordhr <- cbind(DataCoord,COS7hr) ## append a new column at the end
> DataCoordhr <- as.data.frame(DataCoordhr) ## backtransform into data frame
> names(DataCoordhr) <- c("X","Y","Z","COS7hr") ## define new names
>
>
>
> #Merge COS7 and elevation into elev
> elev$COS7 = COS7[[1]] #make them into a single object, replace as newdata
>
>
>
> Does anyone have any ideas?
>
>
>
> Thank you in advance,
>
> Cara
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>   

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de/
http://www.springer.com/978-0-387-78170-9 e.pebesma at wwu.de



More information about the R-sig-Geo mailing list