[R-sig-Geo] problem in producing a HSM on different sites
Mathieu Basille
basille.web at ase-research.org
Tue Jul 9 20:27:43 CEST 2013
Dear Michela,
What you are trying to achieve is not trivial, both from a technical and a
biological point of view. From a technical point of view, this is really a
'sp' issue, and not a 'adehabitatHS' one. The question is to know whether a
SpatialPixelsDataFrame can accept non-contiguous areas. The answer is
probably yes, using a single raster merging all three areas, and the rest
filled in by NAs. This is probably something you can do using R spatial
tools, but I cannot help here.
Second, from a biological point of view, it is not clear what you want to
do. Using a single MADIFA for all three areas would imply that they are
part of the same population, with the same rules that apply to them. In
other words, each site is a sample from the whole population. If it is not
the case, you might as well use three independent MADIFAs, each on a
different study area. In this case, if you're interested into a single
habitat suitability map, I would then suggest to merge individual MADIFA
predictions into a single map. Since the MADIFA predicts (approximate)
Mahalanobis distances, they should be comparable to each other (and could
thus be merged together).
If you consider your three areas as three distinct populations, you might
consider the OMI, for which I already gave you the reference.
Now, I would really advise you to think thoroughly about your problem,
which is not a simple one, and try to understand precisely the aims of each
approach. A good starting point is:
vignette("adehabitatHS")
Hope this helps,
Mathieu Basille.
Le 07/05/2013 04:12 AM, Michela Giusti a écrit :
> Hello again R-users,
>
> I didn't receive any answer regarding my last post on HSM. I think my
> question was not clear.. (sorry..). I try again to explain my problem:
>
> so.. I have 3 different sites along the Mediterranean Sea with different
> extents, coordinates,....on which I performed a MADIFA analysis.
>
>
> Now, I want to produce a final HSM on these 3 sites using the MADIFA
> results. My problem is in "map" in the line command :
>
> pred <- predict(mad, map,..)
>
> I don't know how to prepare a total "map" with my 3 different
> SpatialPixelsDataFrame (how to merge, aggregate, mosaic....them together?)
>
> Below I report my MADIFA results and the structure of my 3 SPDFs:
>
>
> MADIFA
>
> $call: madifa(dudi = pc_mad, pr = pr_mad, scannf = FALSE, nf = 7)
>
> eigen values: 15.58 3.255 0.9557 0.6351 0.2338 ...
>
> $nf: 7 axes saved
>
> vectorlength modecontent
>
> 1 $pr418353 numeric vector of presence
>
> 2 $mahasu 418353 numeric squared Mahalanobis distances
>
> 3 $lw418353 numeric row weights
>
> 4 $cw418353 numeric column weights
>
> 5 $eig8numeric eigen values
>
> data.frame nrowncol content
>
> 1 $tab418353 8modified array
>
> 2 $li418353 7row coordinates
>
> 3 $l1418353 7row normed scores (variance weighted by $pr = 1)
>
> 4 $co87column coordinates
>
> 5 $cor87cor(habitat var., scores) for available points
>
>
>
>> str(SPDF_tuna_norm)
>
> Formal class 'SpatialPixelsDataFrame' [package "sp"] with 7 slots
>
> ..@ data:'data.frame':349272 obs. of8 variables:
>
> .. ..$ aspect: num [1:349272] 1.298 0.583 0.553 1.457 0.627 ...
>
> .. ..$ BPI: num [1:349272] 0.0684 0.0331 0.0251 0.0147 -0.0371 ...
>
> .. ..$ curvature: num [1:349272] 0 -0.0341 -0.001 0.0389 -0.0656 ...
>
> .. ..$ plan.curvature: num [1:349272] 0 -0.0239 -0.0008 0.0005 -0.0434 ...
>
> .. ..$ profile.curvature: num [1:349272] 0 -0.0104 -0.0003 0.0385 -0.023 ...
>
> .. ..$ depth: num [1:349272] -97.4 -97.5 -97.6 -97.6 -97.7 ...
>
> .. ..$ slope: num [1:349272] 0.0871 0.1205 0.0927 0.0685 0.092 ...
>
> .. ..$ TRI: num [1:349272] 0.0617 0.0811 0.0606 0.0581 0.0677 ...
>
> ..@ coords.nrs : num(0)
>
> ..@ grid:Formal class 'GridTopology' [package "sp"] with 3 slots
>
> .. .. ..@ cellcentre.offset: Named num [1:2] 594515 4669713
>
> .. .. .. ..- attr(*, "names")= chr [1:2] "s1" "s2"
>
> .. .. ..@ cellsize: num [1:2] 1 1
>
> .. .. ..@ cells.dim: int [1:2] 396 882
>
> ..@ grid.index : int [1:349272] 1 2 3 4 5 6 7 8 9 10 ...
>
> ..@ coords: num [1:349272, 1:2] 594515 594516 594517 594518 594519 ...
>
> .. ..- attr(*, "dimnames")=List of 2
>
> .. .. ..$ : NULL
>
> .. .. ..$ : chr [1:2] "x" "y"
>
> ..@ bbox: num [1:2, 1:2] 594515 4669713 594911 4670595
>
> .. ..- attr(*, "dimnames")=List of 2
>
> .. .. ..$ : chr [1:2] "x" "y"
>
> .. .. ..$ : chr [1:2] "min" "max"
>
> ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
>
> .. .. ..@ projargs: chr "+proj=utm +zone=32 +ellps=WGS84
> +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
>
>> str(SPDF_monte_norm)
>
> Formal class 'SpatialPixelsDataFrame' [package "sp"] with 7 slots
>
> ..@ data:'data.frame':48333 obs. of8 variables:
>
> .. ..$ aspect: num [1:48333] 5.498 0.303 1.288 1.298 0.785 ...
>
> .. ..$ BPI: num [1:48333] 5.18 6.14 6.8 5.69 6.2 ...
>
> .. ..$ curvature: num [1:48333] 0 0.19 1.03 -1.01 0 ...
>
> .. ..$ plan.curvature: num [1:48333] 0 0.175 0.132 -0.119 0 ...
>
> .. ..$ profile.curvature: num [1:48333] 0 0.0185 0.9835 -0.959 0 ...
>
> .. ..$ depth: num [1:48333] -32.6 -32.5 -32.7 -34.7 -35 ...
>
> .. ..$ slope: num [1:48333] 0.0298 0.2737 0.8512 0.8674 0.3622 ...
>
> .. ..$ TRI: num [1:48333] 0.0211 0.1896 1.176 1.1811 0.268 ...
>
> ..@ coords.nrs : num(0)
>
> ..@ grid:Formal class 'GridTopology' [package "sp"] with 3 slots
>
> .. .. ..@ cellcentre.offset: Named num [1:2] 608418 4685237
>
> .. .. .. ..- attr(*, "names")= chr [1:2] "s1" "s2"
>
> .. .. ..@ cellsize: num [1:2] 1 1
>
> .. .. ..@ cells.dim: int [1:2] 308 190
>
> ..@ grid.index : int [1:48333] 169 170 171 172 173 175 176 177 178 179 ...
>
> ..@ coords: num [1:48333, 1:2] 608586 608587 608588 608589 608590 ...
>
> .. ..- attr(*, "dimnames")=List of 2
>
> .. .. ..$ : NULL
>
> .. .. ..$ : chr [1:2] "x" "y"
>
> ..@ bbox: num [1:2, 1:2] 608418 4685237 608726 4685427
>
> .. ..- attr(*, "dimnames")=List of 2
>
> .. .. ..$ : chr [1:2] "x" "y"
>
> .. .. ..$ : chr [1:2] "min" "max"
>
> ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slots
>
> .. .. ..@ projargs: chr "+proj=utm +zone=32 +ellps=WGS84
> +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
>
--
~$ whoami
Mathieu Basille, PhD
~$ locate --details
University of Florida \\
Fort Lauderdale Research and Education Center
(+1) 954-577-6314
http://ase-research.org/basille
~$ fortune
« Le tout est de tout dire, et je manque de mots
Et je manque de temps, et je manque d'audace. »
-- Paul Éluard
More information about the R-sig-Geo
mailing list