An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-ecology/attachments/20120704/2a5c1ef4/attachment.pl>
combing UDs in homerange analysis
2 messages · Soanes, Louise, Clément Calenge
4 days later
Dear Louise, I already replied to your question on R-sig-Geo [1]. Please avoid cross-posting. Best regards, Cl?ment Calenge [1] https://stat.ethz.ch/pipermail/r-sig-geo/2012-July/015557.html
On 07/04/2012 02:18 PM, Soanes, Louise wrote:
Hello all I am trying to use the kernelbb method to estimate home range of several birds that I have GPS tracked, however I do not want to include time spent on land between trips, so I have performed the analysis on individual trips and then have tried to combine the UD's as has previously been suggested in other posts on this forum, however I am having trouble combining the UD's of the different trips, and does anybody know what the error message below means when I try to work out the 50% homerange area?
data<-read.csv("three.csv")
library(adehabitatHR)
gmt<-(data$gmt)
data$gmt<-as.POSIXct(strptime(gmt, "%d/%m/%Y%H:%M:%S"))
tr=as.ltraj(xy, data$gmt, id, burst = data$Burst, typeII = TRUE, slsp ="remove")
lik<-liker(tr, sig2=1, rangesig1=c(10, 100))
hrBB<- kernelbb(tr, sig1 = 6, sig2 = 1, grid = 100, byburst=TRUE)
hrBB
image(hrBB)
plot(getverticeshr(hrBB, 95), add=TRUE, lwd=2)
plot(getverticeshr(hrBB, 50), add=TRUE, lwd=2)
Error in plot(getverticeshr(hrBB, 50), add = TRUE, lwd = 2) : error in evaluating the argument 'x' in selecting a method for function 'plot': Error in re[[i]] : subscript out of bounds
j<-kernel.area(hrBB, unout=c("km2"))
j
X1 X2 X3 X4
20 0.000000 0.000000 0.000000 0.000000
25 0.000000 0.000000 0.000000 0.000000
30 0.000000 0.000000 0.000000 0.000000
35 0.000000 0.000000 0.000000 0.000000
40 0.000000 0.000000 0.000000 0.000000
45 0.000000 0.000000 1.403292 0.000000
50 0.000000 0.000000 1.403292 0.000000
55 0.000000 0.000000 1.403292 0.000000
60 0.000000 0.000000 1.403292 0.000000
65 0.000000 0.000000 1.403292 0.000000
70 0.000000 0.000000 1.403292 0.000000
75 0.000000 0.000000 1.403292 0.000000
80 0.000000 0.000000 1.403292 0.000000
85 1.403292 0.000000 1.403292 1.403292
90 1.403292 0.000000 2.806585 1.403292
95 2.806585 1.403292 2.806585 2.806585
# I then try to combine these 4 individual UD's using the following code
UDs<- lapply(1:length(hrBB), function(i) hrBB[[i]]$UD)
UDend<- liUD[[1]]
for (i in 2:length(liUD))
UDend<- UDend + liUD[[i]]
nlocs<- unlist(lapply(1:length(tr), function(i) nrow(tr[[i]])))
wi<- nlocs/sum(nlocs)
UDt<- UDs[[1]]
for (i in 2:length(UDs))
UDt<- UDt+wi[i]*UDs[[i]]
# And also tried:
liUD<- lapply(1:length(tr), function(i) {
hrBB[[i]]$UD * (nrow(tr[[i]]) / sum(sapply(tr, nrow)))
})
UDend<- liUD[[1]]
for (i in 2:length(liUD))
UDend<- UDend + liUD[[i]]
But get this error message:
Error in image.default(UDend) : argument must be matrix-like
Any help would be appreciated
Many thanks
Louise Soanes
School of Environmental Sciences
University of Liverpool
Brownlow Hill
L69 3GP
www.puffinisland.org.uk
[[alternative HTML version deleted]]
_______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Cl?ment CALENGE Cellule d'appui ? l'analyse de donn?es Direction des Etudes et de la Recherche Office national de la chasse et de la faune sauvage Saint Benoist - 78610 Auffargis tel. (33) 01.30.46.54.14