get_trading_dates: Produce a table mapping dates on CRSP to "trading days"

View source: R/get_trading_dates.R

get_trading_datesR Documentation

Produce a table mapping dates on CRSP to "trading days"

Description

Produce a table mapping dates on CRSP to "trading days". Returned table has two columns: date, a trading date on CRSP; td, a sequence of integers ordered by date. See vignette("wrds-conn", package = "farr") for more on using this function.

Usage

get_trading_dates(conn)

Arguments

conn

connection to a PostgreSQL database

Value

tbl_df

Examples

## Not run: 
library(DBI)
library(dplyr, warn.conflicts = FALSE)
pg <- dbConnect(RPostgres::Postgres())
get_trading_dates(pg) %>%
  filter(between(date, as.Date("2022-03-18"), as.Date("2022-03-31")))

## End(Not run)

farr documentation built on Feb. 16, 2023, 8:11 p.m.