[R] Saving iterative components
Annalaura
annalaura.russo at imaa.cnr.it
Fri Sep 24 17:51:48 CEST 2010
Hi, I need help!
I am trying to iterate an iterative process to do cross vadation and store
the results each time.
I have a Spatial data.frame, called Tmese
> str(Tmese)
Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
..@ data :'data.frame': 14 obs. of 17 variables:
.. ..$ ID : int [1:14] 73 68 49 62 51 79 69 77 57 53 ...
.. ..$ Stazione: Factor w/ 29 levels "ALIANO","BONIFATI",..: 2 3 4 5 10 11
12 16 17 19 ...
.. ..$ X01_1994: num [1:14] 9.34 10.67 5.29 11.86 9.15 ...
.. ..$ X01_1995: num [1:14] 7.07 9.22 2.32 9.3 6.66 ...
.. ..$ X01_1996: num [1:14] 9.41 10.4 5.99 12.3 9.93 ...
.. ..$ X01_1997: num [1:14] 10.67 10.65 5.76 12.82 10.1 ...
.. ..$ X01_1998: num [1:14] 9.57 10.12 4.44 10.34 8.97 ...
.. ..$ X01_1999: num [1:14] 8.96 10.21 3.23 10.83 7.74 ...
.. ..$ X01_2000: num [1:14] 6.58 8.46 2.8 8.37 6.55 ...
Now I want to do 14 cross validation and I wrote a function
idw.cv<- function(x){
tmp<- krige.cv(x~1, Tmese, model=NULL)
return(tmp)
}
But when I run it, it doesn't work, it says:
> cv_1994<- idw.cv(X01_1994)
Error in eval(expr, envir, enclos) : object 'X01_1994' not found
Why????Please Help me!
--
View this message in context: http://r.789695.n4.nabble.com/Saving-iterative-components-tp2553676p2553676.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list