Hello all!
I am attempting to submit manual weights to the akde function. A few months ago I was able to use this functionality ok but, after taking a few months break from my code, it seems like akde is no longer using the vector of weights supplied and just providing each observation with equal weight. Has anyone else had this issue/have advice for how to get around it? Below is a bit of my code that was functional in May. Telem_all_ds is a list of telemetry object where each individual has a telemetry object in the list. The script is working but when I pull the weights used they are all the same value.
kde_all_ds <-
names(telem_all_ds) %>%
set_names() %>%
map(
~ akde(
telem_all_ds[[.x]],
SP = land_sp,
# Locations expected to be outside of the polygon:
SP.in = FALSE,
# Don't include auto-correlation:
CTMM = iid_all_ds[[.x]],
# Include manual weights:
weights = points_for_telem %>%
filter(id == .x) %>%
# Break into telemetry groups:
split(f = .$individual.local.identifier) %>%
map(
~.x %>%
pluck("weights") %>%
# Standardize the values so they sum to 1:
{ . / sum(., na.rm = TRUE) }
)
)
)
Thanks for the help!
Annika