# Time variable
dat_out <- insurgencies[1:100, ]
dat_out$time <- as.numeric(dat_out$date - min(dat_out$date) + 1)
# Hyperframe
dat_hfr <- get_hfr(data = dat_out,
col = "type",
window = iraq_window,
time_col = "time",
time_range = c(1, max(dat_out$time)),
coordinates = c("longitude", "latitude"),
combine = TRUE)
# Get the number of events for each pixel
pixel_count_ppp(data = dat_hfr$all_combined)
Run the code above in your browser using DataLab