Message-ID: <HE1PR0101MB2233102C40817D798F138CB4D34E0@HE1PR0101MB2233.eurprd01.prod.exchangelabs.com>
Date: 2016-05-23T13:23:44Z
From: yasmine mohamed
Subject: TSA error using packet 1 any (sp) is not TRUE
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]]