Skip to content
Prev 1346 / 7420 Next

do the standard R analysis functions handle spatial "grid" data?

Not sure which 'logistic function' you're asking about, but logistic
regression is a case of the generalized linear model and can be fit
with base::glm.  It's been awhile since I've done this sort of thing
but as I recall I exported stacked rasters of predictors as XYZ ASCII
files (possibly after multiplying floating points by powers of 10 and
rounding to work with integers), and then merged on unique xy values
to form a matrix with one location (e.g raster cell centroid) per row
and k+2 columns where k is the number of layers and +2 for the x and y
values. Note that any glm inferences (including predictive inference)
will assume independent errors conditional on the model matrix.  To
use the xy values for independence diagnostics etc you'll want a
projection that preserves distance.

The rgdal, maptools and sp packages provide functions and classes for
working w/ spatial data (see the spatial Task View on CRAN).  Also, it
sounds as though the adehabitat package will be useful for your
application, and possibly the grasp and ModelMap packages as well.

Kingsford Jones



On Mon, Jul 12, 2010 at 8:51 PM, Chris Howden
<chris at trickysolutions.com.au> wrote: