Hi to everybody. Few weeks ago I performed successfully a Thin plate spline
regression ("Tps" function from fields package) following instructions given
in this forum by professor Robert J. Hijmans.
In that moment I calculated successfully the standard errors for the Tps
predictions using the option fun=predict.se from "interpolate" function in
raster package. I ran this procedure following this code:
Datos <-
read.table("F:/Especies_Invasoras/Evaporacion/evaporacion_sabana.txt",
header=T, sep="\t", na.strings="NA", dec=".", strip.white=TRUE)
Eva2 <- Tps(Datos[,17:19], Datos$Anual) # X,Y and Elevation as independent
variables for predict annual evaporation values
Elevacion <- raster("F:/Especies_Invasoras/Evaporacion/altura.asc") # ascii
grid of elevation values projected onto the desired area
Raster2 <- interpolate(Elevacion, Eva2, xyOnly=FALSE)
RasterSe2 <- interpolate(Elevacion, Eva2, xyOnly=FALSE, fun=predict.se)
I?ve tried to repeat this procedure in this moment but I can?t obtain the
standard errors from predictions. When I run the last line code I obtain the
same values for Tps predictions ran in penultimate line code. It seems to be
that now the option "fun=predict.se" is not being recognized. I work under
Rx64 version 2.11.1 and raster package version 1.2-6.
Additionally I have a question about the code when I include an other
independent variable like slope for example. I think the code should be
something like:
?Datos <-
read.table("F:/Especies_Invasoras/Evaporacion/evaporacion_sabana.txt",
header=T, sep="\t", na.strings="NA", dec=".", strip.white=TRUE)
Eva2 <- Tps(Datos[,17:20], Datos$Anual) # X,Y, Slope and Elevation as
independent variables for predict annual evaporation values
Elevacion <- raster("F:/Especies_Invasoras/Evaporacion/altura.asc") # ascii
grid of elevation values projected onto the desired area
Slope <- raster("F:/Especies_Invasoras/Evaporacion/slope.asc") # ascii grid
of slope values projected onto the desired area
Raster2 <- interpolate(Elevacion, Slope, Eva2, xyOnly=FALSE)
RasterSe2 <- interpolate(Elevacion, Slope, Eva2, xyOnly=FALSE, fun=
predict.se)
but "interpolate" function presents this error: "Error in model$terms : $
operator not defined for this S4 class"
I appreciate your help. Best regards for every body.
--
Jaime Burbano Gir?n
Departamento de Ecolog?a y Territorio
Pontificia Universidad Javeriana
Bogot? - Colombia
3208320 Ext. 4839 - 3168573713
? ? ? ?[[alternative HTML version deleted]]