[R-sig-Geo] complex coastline and adehabitatHR: trouble with kerneloverlaphr function after coastline has been clipped out

Phil H pharriso at uwaterloo.ca
Fri Apr 26 22:27:35 CEST 2013


I notice that the kernal.area function does not seem to work with this
clipped UD.

I suspect that it could be related to the "fake" h values provided by the
code

fullgrid(udspdf) <- FALSE
re <- lapply(1:ncol(udspdf), function(i) {
so <- new("estUD", udspdf[,i])
so at h <- list(h=0, meth="specified") # fake value
so at vol <- FALSE
return(so)
})

as these seem to be the only differences I can find in the between the
clipped and non-clipped data str
see below for an example...........


str(re)
List of 4
 $ Brock:Formal class 'estUD' [package "adehabitatHR"] with 9 slots
  .. ..@ h          :List of 2
  .. .. ..$ h   : num 0
  .. .. ..$ meth: chr "specified"

str(ud)
List of 4
 $ Brock:Formal class 'estUD' [package "adehabitatHR"] with 9 slots
  .. ..@ h          :List of 2
  .. .. ..$ h   : num 212
  .. .. ..$ meth: chr "href"


I am attempting to use the BRB approach following the walrus thread script
http://grokbase.com/t/r/r-sig-geo/116mj7w0wx/walruses-and-adehabitathr-class-estudm-exclusion-of-non-habitat-pixels-and-summary-over-all-animals

however I get just the same issues. where BRBUDnotclipped<- is UD created in
the BRB above (not clipped)
str(BRBUDnotclipped)
$ Brock: :Formal class 'estUD' [package "adehabitatHR"] with 9 slots
  .. ..@ h          :List of 3
  .. .. ..$ values:List of 2
  .. .. .. ..$ hmin: num 100
  .. .. .. ..$ D   :List of 4
  .. .. .. .. ..$ Brock: num 4.26
  .. .. .. .. ..$ Calou: num 1
  .. .. .. .. ..$ Chou : num 1.86
  .. .. .. .. ..$ Jean : num 6.21
  .. .. ..$ interp:'data.frame':        62 obs. of  3 variables:
  .. .. .. ..$ x: num [1:62] 699889 699968 700046 699644 699242 ...
  .. .. .. ..$ y: num [1:62] 3161559 3161550 3161541 3161372 3161202 ...
  .. .. .. ..$ h: num [1:62] 100 612 100 704 704 ...

and where the BRB clipped UD structure again looks like this

str(UDclipped)
List of 4
 $ Brock:Formal class 'estUD' [package "adehabitatHR"] with 9 slots
  .. ..@ h          :List of 2
  .. .. ..$ h   : num 0
  .. .. ..$ meth: chr "specified"


My idea so far has been to try and re-populate the h slot with my BRB.lik
values ie vv2
so far I have tried  

fullgrid(udspdf) <- FALSE
re <- lapply(1:ncol(udspdf), function(i) {
so <- new("estUD", udspdf[,i])
so at h <- list(hmin=100,D=vv2, meth="BRB-specified")
so at vol <- FALSE
return(so)
})

however I dont know how to work with the $interp slot and I cannot seem to
extract the D value only from the vv2 of class "DBRB". And to be honest I am
not really sure I am correctly addressing the root of the problem? Does
anyone have any ideas why this approach doesnt work and why clipped UDs do
not work with kerneloverlap? Could it be related to the getvolumeUD function
which is used in both the kerneloverlaphr function and also in the
kernel.area function? 
sorry to repost on the same topic with no further enlightenment. I guess I
could try exporting the UD to GIS and clipping it and returning it to
adehabitatHR however I imagine this approach would also be tricky and I am
not a huge fan of arcGIS and would much prefer to crack this in R! 

Surely it is not impossible to generate overlap indexes with clipped
datasets? Perhaps I am making some very rookie mistake?

Thanks for your time

Phil H











--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/complex-coastline-and-adehabitatHR-trouble-with-kerneloverlaphr-function-after-coastline-has-been-clt-tp7581851p7583419.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list