[R-sig-Geo] spBayes package spLM function

Helen Chen hc10024 at gmail.com
Fri Jul 24 00:12:46 CEST 2015


I have tried to implement the spLM function from spBayes package to my data
(rainfall value, elevation, coordinates).

However, the error message shows up when I run this chunk of codes:

bef.sp <- spLM(S3~elv,
+ data=A, coords=cook, starting=list("phi"=3/200,"sigma.sq"=0.08,
+ "tau.sq"=0.02), tuning=list("phi"=0.1, "sigma.sq"=0.05, "tau.sq"=0.05),
+                priors=list("phi.Unif"=c(3/1500, 3/50), "sigma.sq.IG"=c(2,
0.08),"tau.sq.IG"=c(2, 0.02)), cov.model="spherical",n.samples=n.samples)

the error message is

Error in spLM(S3 ~ elv, data = A, coords = cook, starting = list(phi =
3/200,  :
  error: coords must n-by-2 matrix of xy-coordinate locations

I am sure that my coordinates is a 29 by 2 matrix, but it also tells me
this error message.

Could anyone help me to figure out. Thanks for all your help.


	[[alternative HTML version deleted]]

More information about the R-sig-Geo mailing list