Hi Chris,
I am attempting to get the occurrence distribution of all the females in my study population using a common grid. I have used this raster grid successfully with the AKDE function in order to get overlap values for the females' UDs. However, I am getting an error when I try to use the same raster grid in the occurrence function.
Running the following code:
ODs <- vector("list", length = 240)
for(i in 1:length(fem_telem)){
cat(paste("Estimating Occurrence distribution of individual", i))
ODs[[i]] <- occurrence(fem_telem[[i]], models[[i]], variable = "utilization", grid = density)
}
produces an error "invalid layer names." Using traceback, it appears to be an issue with the grid.
Error in .local(x, ...) : invalid layer names
12. stop("invalid layer names")
11. .local(x, ...)
10. subset(x, i, drop = drop)
9. subset(x, i, drop = drop)
8. .local(x, i, j, ...)
7. x[[name]]
6. x[[name]]
5. grid$r
4. grid$r
3. kde.grid(data, H = H, axes = axes, alpha = alpha, res = res,
dr = dr, grid = grid)
2. kde(data, H = H, W = w.grid, dr = dr/res.space, grid = grid)
1. occurrence(fem_telem[[i]], models[[i]], variable = "utilization",
grid = density)
When I run the function without the grid, I have no problems, e.g.
test_od <- occurrence(t_1, m_1, variable = "utilization") runs just fine.
Do you have any idea how I might adjust the properties of my raster grid to avoid this error? Thanks in advance!
Jenny