pub_date: Returns the next publication date

View source: R/dater.R

pub_dateR Documentation

Returns the next publication date

Description

Takes the publication day, week and other parameters and returns the next publication date. Can be used to find previous publications by specifying the months ago parameter.

Usage

pub_date(
  pub_day,
  pub_week,
  first_pub,
  frequency,
  bi_start = NA,
  mago = 0,
  input_date = lubridate::today(),
  test = FALSE
)

Arguments

pub_day

what day of the week is your publication (3 letter starting with capital - Mon, Tue, Wed etc.)

pub_week

which week of the month do you publish (1, 2, 3, 4 or 5 for the last week)

first_pub

in what month is the first publication of the calendar year (if quarterly this should be 1, 2 or 3)

frequency

how often do you publish (monthly, quarterly, annually, biennially)

bi_start

biennial publications only is the year of publication "odd" or "even"

mago

Reduce the date by this many months The following 2 are only set when testing

input_date

defaults to today's date, however for testing purposes can be changed to an arbitrary date

test

set to TRUE when testing the function, otherwise defaults to FALSE

Details

This will take today's date and find the next publication date for a publication specified using the below parameters. It does a check to make to make sure that it is not a past date unless backdating is specified.

Examples

pub_date(pub_day = "Thu", pub_week = 2, first_pub = 2, frequency = "quarterly",
bi_start = NA , mago = 0)



moj-analytical-services/mojrap documentation built on July 30, 2023, 4:43 p.m.