R/mk_map.R

Defines functions mk_map

mk_map <- function(tab,  grid, mask = NULL) {
  tab <- tab %>% 
    group_by(cell) %>% 
    summarize(timespent = sum(value))
  wmap <- setValues(grid, NA_real_)
  wmap[tab$cell] <- tab$timespent
  if (!is.null(mask)) wmap[is.na(mask)] <- NA_real_
  wmap
}
mdsumner/splat documentation built on July 2, 2017, 6:24 p.m.