Dear All I hope that someone can help.

I am working with sp pakage and akima
library("akima")
library(sp)



imagine lots of different dataframes, of row = 100 columns = 3 of  x and y
coordinates with z values I will call these data frames for the sake of this
example akima

akima<-as.list(1:100)

producing 100 dataframes dataframes of the form akima[[i]]

I then wish to interp this list of coordinates:

akima.li<-as.list(1:100)
for (i in 1:100) akima.li[[i]]<-interp(akima[[i]]$x, akima[[i]]$y, akima
[[i]]$z)

so now I have 100 akima.li which I then transform into a dataframe of the
akima.li values

y<-as.list(1:100)
x<-as.list(1:100)
z<-as.list(1:100)

for (i in 1:endofrun){
y[[i]]= rep(akima.li[[i]]$x, each = length(akima.li[[i]]$y))
x[[i]] = rep(akima.li[[i]]$y, length(akima.li[[i]]$x))
z[[i]] = as.numeric(akima.li[[i]]$z)
}

abc<-as.list(1:100)

for (i in 1:endofrun){
abc[[i]]<- data.frame(x[[i]], y[[i]], z[[i]])
abc[[i]][is.na(abc[[i]])] <- 0}



so now I have 100 dataframes with x and y columns and corresponding z values
and any NAs are now 0.

This is where my problem starts I wish to use sp to state which columns are
coordinates of the form

for (i in 1:100) coordinates(abc[[i]])= ~x+y

and that all of the dataframes are a grid, such that.

for (i in 1:100)  gridded(abc[[i]]) = TRUE

however I get error messeges such as:
Error in function (classes, fdef, mtable)  :  unable to find an inherited
method for function "coordinates<-", for signature "integer"

and I do not know what this means.

I will then want to then go on to overlay such:

datapoint = data.frame(x = 10, y = 20)
coordinates(datapoint) = ~x+y
gridded(datapoint)=TRUE

value<-as.list(1:100)

for (i in 1:100)   value [[i]]= abc[[i]]@data[overlay(abc[[i]], datapoint),]

then I will have a list of 100 "value" for each original dataframe

I would be appreciative if someone could tell me how I can allocate
coordinate and grided systems to an dataframes which are as.list.

I hope that is comprehendable and someone can help. I am very stuck

many thanks Sylvestre

	[[alternative HTML version deleted]]

