R/filter_date.R

Defines functions filter_date

Documented in filter_date

#' Filter by date
#' 
#' Filter for existing municipalities at a specific point in time.
#'
#' @param tbl A tibble
#' @param date A \code{Date} object of length one.
#' 
#' @return A tibble which is a subset of \code{tbl}
#' 
#' @export

filter_date <- function(tbl, date) {
  
  tbl <- filter(tbl, admission_date <= date & (abolition_date > date | is.na(abolition_date)))
  
  return(tbl)
}

Try the SMMT package in your browser

Any scripts or data that you put into this service are public.

SMMT documentation built on April 4, 2022, 1:07 a.m.