Skip to contents

This function checks that the given period code is valid. If the range or format is not valid, the function throws an error message indicating which codes are invalid. It also converts the input to the proper format if necessary.

Usage

check_date(start_date, end_date, frequency)

Arguments

start_date

The start date of the query, either in the format `yyyy` or `yyyy-mm`.

end_date

The end date of the query, either in the format `yyyy` or `yyyy-mm`. Can be a maximum of 12 years after the start date for the annuel frequency or one year for monthly.

frequency

The frequency of reported trade data, either `A` for annual or `M` for monthly.

Value

A character vector of valid reporter IDs.

Examples

if (FALSE) { # interactive()
check_date(2010,2011,'A')
}