data(deer)
data(sh_forest)
mini_deer <- deer[1:20, ]
mini_deer %>% extract_covariates(sh_forest)
mini_deer %>% steps %>% extract_covariates(sh_forest)
mini_deer %>% steps %>% extract_covariates(sh_forest, where = "start")
# Buffer
mini_deer %>% extract_covariates(sh_forest) # no buffer
# The command buffer can be used, to buffer each point together with a
# function to summarize the results.
mini_deer %>% extract_covariates(sh_forest, buffer = 10, fun = mean)
# This can also be a use-specified function.
mini_deer %>% extract_covariates(sh_forest, buffer = 100, fun = function(x) length(x))
# \donttest{
# Illustration of extracting covariates along the a step
mini_deer %>% steps() %>% random_steps() %>%
extract_covariates(sh_forest) %>% # extract at the endpoint
mutate(for_path = extract_covariates_along(., sh_forest)) %>%
# 1 = forest, lets calc the fraction of forest along the path
mutate(for_per = purrr::map_dbl(for_path, ~ mean(. == 1)))
# }
Run the code above in your browser using DataLab