Dear All,

I am using the BRB function of the adehabitatHR package and want to include
a boundary. Everything works fine with producing the UD without the
boundary but when I include it I get an error. Below is the code that I
have been using, following instructions from the vignette:

 bound<-structure(list(x=c(
754422.787,769704.925,802302.160),y=c(7807547.327
,7827499.149,7827039.971)),.Names=c("x","y"))
>  bound<-do.call("cbind",bound)
> Sloi<-Line(bound)
> Slii<-Lines(list(Sloi),ID="frontier1")
> barrier<-SpatialLines(list(Slii))
>  projection(barrier)<-CRS("+proj=utm +zone=34 +south +ellps=WGS84
+towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
> barrier
An object of class "SpatialLines"
Slot "lines":
[[1]]
An object of class "Lines"
Slot "Lines":
[[1]]
An object of class "Line"
Slot "coords":
            x       y
[1,] 754422.8 7807547
[2,] 769704.9 7827499
[3,] 802302.2 7827040



Slot "ID":
[1] "frontier1"



Slot "bbox":
        min       max
x  754422.8  802302.2
y 7807547.3 7827499.1

Slot "proj4string":
CRS arguments:
 +proj=utm +zone=34 +south +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m
+no_defs

>
ud<-BRB(bianca,D=vv,Tmax=540*60,tau=300,Lmin=90,hmin=100,habitat=bian1207,grid=bian1207,b=0,same4all=F,extent=bian1207,boundary=barrier)
Error in rowSums(re) : 'x' must be an array of at least two dimensions

All of the segments are larger than hmin*3 and have no sharp turns.
Plotting the boundary file gives the correct shape. I have included the
projection in this example but I have tried without the projection and have
received the same error message.

I thought that perhaps the extent of the boundary was too large for the
plot, so I defined a smaller boundary (still larger than hmin*3) and then
received this error message:
>
ud<-BRB(bianca,D=vv,Tmax=540*60,tau=300,Lmin=90,hmin=100,habitat=bian1207,grid=bian1207,b=0,same4all=F,extent=bian1207,boundary=barrier)
Error in abs(alphaj) : Non-numeric argument to mathematical function

Does anyone have any advice please?

Many Thanks

Emily
-- 
Okavango Buffalo Research

University of Bristol (UK)

University of Botswana

www.okavango-buffalo-research.com
http://www.bio.bris.ac.uk/research/mammal/buffalos.html

	[[alternative HTML version deleted]]

