# NOT RUN {
library(ggplot2)
library(dplyr)
library(sf)
comp_dist <- 1
ggplot() +
geom_sf(data = growth_spatial_ex, aes(col = buffer), size = 2)
ggplot() +
geom_sf(data = growth_spatial_ex, aes(col = foldID), size = 2)
# Create the focal versus comp data frame
focal_vs_comp_ex <- growth_spatial_ex %>%
mutate(basal_area = 0.0001 * pi * (dbh1 / 2)^2) %>%
create_focal_vs_comp(comp_dist, blocks = blocks_ex, id = "ID", comp_x_var = "basal_area")
# }
Run the code above in your browser using DataLab