if (FALSE) {
wrds <- wrds_connect()
# Preview table structure first
describe_table(wrds, "crsp", "msf")
# Get a lazy table and build your query
get_table(wrds, "crsp", "msf") |>
dplyr::filter(date >= "2025-01-01") |>
dplyr::select(permno, date, ret, prc, vol) |>
dplyr::collect()
# Collect immediately with specific columns
get_table(wrds, "crsp", "dsf",
columns = c("permno", "date", "ret", "prc"),
lazy = FALSE,
n = 1000
)
# Access any table in any library
get_table(wrds, "ibes", "statsum_epsus") |>
dplyr::filter(fpedats >= "2025-01-01") |>
dplyr::collect()
wrds_disconnect(wrds)
}
Run the code above in your browser using DataLab