0

I'm using adehabitatHR to estimate home range for penguins. Naturally, they can't swim on land, and I have been trying to add a boundary around the coastline to prevent the KUD from adding more area than is feasible.

The area I'm trying to create the boundary for is the north end of Port Phillip Bay, Australia. The current (very rough) boundary points I have, in sequence, are:

-37.9967038 145.0346375

-37.8607599 144.9783325

-37.8341917 144.9131012

-37.8580493 144.8375702

-37.9988682 144.6487427

Whilst it is accepted as a barrier, and can be plotted on the map, I keep getting an error when I try to implement it as a boundary in the KUD:

'Error in 3*h:non-numeric argument to binary operator'

Does anyone know what this means and how I might fix it?

Thanks!

Zairi
  • 31
  • 3

1 Answers1

0

Be sure your are following all these step before to input in as a boundary in the KUD.

bnd <- structure(list(x = c(-37.9967038, -37.8607599, -37.8341917, 
                            -37.8580493, -37.9988682),
                      y = c(145.0346375, 144.9783325, 144.9131012,
                            144.8375702, 144.6487427)),
                 .Names = c("x", "y"))

bnd <- do.call("cbind", bnd)
Slo <- Line(bnd)
Sli <- Lines(list(Slo), ID = "Frontiers")
barrier <- SpatialLines(list(Sli))

So, the object barrier is your boundary thus you will need to specify it in the kud function:

kernelUD("your spatial data", h = "your bandwidth", grid = "your grid",
          boundary = barrier)

All the best,

Irbin B.
  • 382
  • 3
  • 18