[R-sig-Geo] fitting lag model in R

2012-12-29 Thread Milan Sharma
Hi all, can any one of you see whats wrong in the code below?  model-lm(Tcrash~X100MVMT+Alcohol+Alignment+PVMT, data=data)#works sar-spautolm(Tcrash~X100MVMT+Alcohol+Alignment+PVMT,listw=WI_queenW, data=data)#works lag - lagsarlm(Tcrash~X100MVMT+Alcohol+Alignment+PVMT, data=data,

[R-sig-Geo] back to variogram

2012-12-29 Thread Hodgess, Erin
Hello yet again: I have a little data set that I want to get a variogram for. However, I keep getting an error. str(z1.df) Formal class 'SpatialPointsDataFrame' [package sp] with 5 slots ..@ data :'data.frame':5 obs. of 1 variable: .. ..$ x: num [1:5] 1.4228 0.0275 -0.3738

[R-sig-Geo] function to convert 3D geographical coordinates to Cartesian?

2012-12-29 Thread Tom Roche
Is there packaged code to convert geographical coordinates (e.g., longitude, latitude, elevation) to Cartesian coordinates in 3-space? The spherical-to-Cartesian math is straightforward enough, but there's certainly scope for error, so I'd prefer to use tested, previously-used code if available.