[R-sig-eco] AdehabitatHR, BRB-kernel calculation problem.

NickvanDoormaal nickvandoormaal26 at hotmail.com
Tue Jan 7 10:14:23 CET 2014


Link to dataset:  http://we.tl/BOuhqvyOsm <http://we.tl/BOuhqvyOsm>  

Hello everyone,

I have troubles with the calculations of the Biased Random Bridge kernels
(BRB) with the adehabitatHR-package. I have a dataset of 10 individuals with
hourly relocations for several months. For some reason, I am not able to
calcualate BRB for some individuals. The R-program crashes and then closes.
I have included a part of my dataset. With this dataset, I am not able to
calculate the BRB for the last individual (Sala_Male). This is the script I
used:

*##LOAD ANIMAL RELOCATIONS*
june2012 <-readShapeSpatial("Elephant_GPS_DATA_2012-06.shp")

*##SET COORDINATE SYSTEM*
proj4string(june2012) = CRS("+init=epsg:4326")

*##TRANSFORM COORDINATES*
june2012 <- spTransform(june2012, CRS("+init=epsg:32737"))

june2012$Date_old <- NULL

*##CONVERT TO CLASS AS.LTRAJ*
da <- as.character(june2012$Date)
da <- as.POSIXct(strptime(as.character(june2012$Date),"%d/%m/%Y %H:%M"))
june2012df <- as.data.frame(june2012)
xyjune2012 <- coordinates(june2012)
elejune2012 <- as.ltraj(xy =xyjune2012, date = da, id = june2012df$ID)

*##GET D-PARAMETER FOR THE FIRST ANIMAL*
tr1 = elejune2012[1]
vv.01 = BRB.likD(tr1, Dr=c(1,100), Tmax = 4*3600, Lmin = 500)

*##CALCULATE BRB*
id.01 <- BRB(tr1, D = vv.01, Tmax = 4*3600, tau = 360, Lmin = 500,
hmin=1000, grid = 100, type=("ID"), same4all=FALSE, extent=0.1, maxt =
4*3600, filtershort=TRUE)
rd.01 <- BRB(tr1, D = vv.01, Tmax = 4*3600, tau = 360, Lmin = 500,
hmin=1000, grid = 100, type=("RD"), same4all=FALSE, extent=0.1, maxt =
4*3600, filtershort=TRUE)
ud.01 <- BRB(tr1, D = vv.01, Tmax = 4*3600, tau = 360, Lmin = 500,
hmin=1000, grid = 100, type=("UD"), same4all=FALSE, extent=0.1, maxt =
4*3600, filtershort=TRUE)

This goes well for up to the 9th individual. However it goes wrong for the
10th individual:

tr10 = elejune2012[10]
vv.10 = BRB.likD(tr10, Dr=c(1,100), Tmax = 4*3600, Lmin = 500)
id.10 <- BRB(tr10, D = vv.10, Tmax = 4*3600, tau = 360, Lmin = 500,
hmin=1000, grid = 100, type=("ID"), same4all=FALSE, extent=0.1, maxt =
4*3600, filtershort=TRUE)
rd.10 <- BRB(tr10, D = vv.10, Tmax = 4*3600, tau = 360, Lmin = 500,
hmin=1000, grid = 100, type=("RD"), same4all=FALSE, extent=0.1, maxt =
4*3600, filtershort=TRUE)
ud.10 <- BRB(tr10, D = vv.10, Tmax = 4*3600, tau = 360, Lmin = 500,
hmin=1000, grid = 100, type=("UD"), same4all=FALSE, extent=0.1, maxt =
4*3600, filtershort=TRUE)

Does it has something to with the value of 'vv.10'?

Any help would be very much appreciated!
Thank you for your time



--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/AdehabitatHR-BRB-kernel-calculation-problem-tp7578626.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.



More information about the R-sig-ecology mailing list