[R-sig-Geo] TSA error using packet 1 any (sp) is not TRUE

yasmine mohamed yasmine.mohamed at Bue.edu.eg
Mon May 23 15:23:44 CEST 2016


Hello Guys,

I am trying to do Trend Surface Analysis (TSA) via OLS as rainfall function of longitude and latitude. This TSA needs spatialgriddataframe which is grd. The code went fine, but the graph has the following message written inside

error using packet 1 any (sp) is not TRUE

Here is my Code:

rain.tsm <- lm(rain~I(LON^2)+ I(LAT^2)+I(LON*LAT), data=yr757.eda)

summary(rain.tsm)

library(sp)

gridded(grd) = TRUE # Make it a grid

grd$tsm.pred <- predict(rain.tsm, grd)

pts <- list('sp.points', yr757.eda, pch=1, cex=0.7, col='black')

spplot(grd, zcol='tsm.pred', first= FALSE, scales=list(draw=T), main="Rainfall Estimates (Trend Surface Model)", sp.layout=pts)

Cheers,
Yasmine

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list