R/cong_to_year.R

Defines functions cong_to_year

Documented in cong_to_year

#' @title Convert between Congress Number and Election Year
#'
#' @description Some data is by year and some with congress number.
#'     Inevitably, you need it the other way...
#'
#' @param cong the congress number (1 to... 115 as of 2018, but any integer will work)
#' @export
#'
#' @examples
#'
#' # the 100th congress was elected in 1986
#'
#' cong_to_year(100)
#'

cong_to_year <- function(cong) {

  return(cong * 2 + 1786)

}
jamesfeigenbaum/jjfPkg documentation built on March 31, 2022, 5:33 p.m.