Hi,

I am testing levels of association between an environmental variable,
extracted from a raster, and a time spent per unit area grid, created using
the 'trip' package to determine whether the habtiat variable influences the
amount of time spent in that grid cell by an animal.  Both grids have been
set to the same resolution.  I would like to use a Mantel test to assess
levels of 2D correlation.  I have created a dissimilarity matrix using
values extracted from the raster and now need a comparable matrix
describing the 'time spent' data.

These 'time spent' data are arranged as a slot in a SpatialGridDataFrame,
known here as tpc.for@data$z.  When I try to extract these data as a matrix:
> ff <- as.matrix(tpc.for@data$z)

the resultant object is only one-dimensional and then when I try to apply
the function 'distance' from package 'ecodist', to calculate dissimilarity
matrix, I get the following error:

> gg <- distance(ff, "bray-curtis")
Error in numeric(N * N * P) : vector size cannot be NA
In addition: Warning message:
In N * N : NAs produced by integer overflow

Any ideas on how I can extract the time spent values from the 'trip' object
as a matrix, the dimensions of which will match the raster dimensions?
Using 'image' plots the values at the same resolution.

Any help would be very much appreciated.

Kylie Scales

	[[alternative HTML version deleted]]

