download_data_wrds_compustat {tidyfinance}R Documentation

Download Data from WRDS Compustat

Description

This function downloads financial data from the WRDS Compustat database for a given type of financial data, start date, and end date. It filters the data according to industry format, data format, and consolidation level, and returns the most current data for each reporting period. Additionally, the annual data also includes the calculated calculates book equity (be), operating profitability (op), and investment (inv) for each company.

Usage

download_data_wrds_compustat(
  type,
  start_date,
  end_date,
  additional_columns = NULL
)

Arguments

type

The type of financial data to download.

start_date

Optional. A character string or Date object in "YYYY-MM-DD" format specifying the start date for the data. If not provided, a subset of the dataset is returned.

end_date

Optional. A character string or Date object in "YYYY-MM-DD" format specifying the end date for the data. If not provided, a subset of the dataset is returned.

additional_columns

Additional columns from the Compustat table as a character vector.

Value

A data frame with financial data for the specified period, including variables for book equity (be), operating profitability (op), investment (inv), and others.

Examples


  download_data_wrds_compustat("wrds_compustat_annual", "2020-01-01", "2020-12-31")
  download_data_wrds_compustat("wrds_compustat_quarterly", "2020-01-01", "2020-12-31")

  # Add additional columns
  download_data_wrds_compustat("wrds_compustat_annual", additional_columns = c("aodo", "aldo"))


[Package tidyfinance version 0.3.0 Index]