Skip to content

tidyfinance

0.9.0Package record

Tidy Finance Helper Functions

0packages depend
10.5Kdownloads / year
100.0%test coverage
13/13flavors OK

Overview

About

Helper functions for empirical research in financial economics, addressing a variety of topics covered in Scheuch, Voigt, and Weiss (2023) doi:10.1201/b23237. The package is designed to provide shortcuts for issues extensively discussed in the book, facilitating easier application of its concepts. For more information and resources related to the book, visit https://www.tidy-finance.org/index.html.

Changes in 0.9.0

Breaking changes

  • download_factor_library_ids() and download_data("Tidy Finance", "factor_library") read the new layout of the factor library on Hugging Face, where the returns hold only id, date, and ret in files of 1,000 consecutive IDs named after their range. Only the files that hold the requested IDs are downloaded, and the file listing of the dataset is no longer queried. The result no longer has a ret_type column; the weighting scheme is in the weighting_scheme column of the grid. Earlier versions of the package cannot read the new layout.
  • The factor library now builds on the signals of Open Source Asset Pricing, so sorting variables carry their names, e.g. "size" instead of "me" and "high52" instead of "52w". The examples and the documented grid values follow the new release, which adds the "1m" lag and "capped VW" weighting.
Show all changes in 0.9.0Hide the rest of the changes in 0.9.0

New features

  • download_data_constituents() gains a path argument that reads an iShares or BlackRock holdings CSV saved from the fund's web page instead of downloading it, e.g. download_data("Index Constituents", path = "holdings.csv"). index is optional with path. Use it as a fallback when the provider moves its files (#311).
  • Added download_data_fred_md() and the "FRED-MD" / "FRED-QD" datasets for download_data("FRED", ...), which download the McCracken and Ng (2016, 2021) curated monthly / quarterly macro panels as wide tables (one column per series). transform = TRUE applies each series' stationarity transform code (tcode). vintage selects the current release (default), a specific "YYYY-MM" release, or "all" - the full real-time panel across every archived vintage (recent vintages are hosted individually; older ones are read from the St. Louis Fed vintage archive ZIPs), enabling leak-free point-in-time analysis.

Bug fixes

  • download_data_constituents() works again for DAX, EURO STOXX 50, Dow Jones Industrial Average, S&P 500, Nasdaq 100, FTSE 100, MSCI World, STOXX Europe 600, MDAX, TecDAX, MSCI Emerging Markets, and MSCI Europe. iShares removed the German retail pages the holdings files were downloaded from; they are now read from the Swiss professional pages. The header row of a holdings file is detected automatically instead of skipping a fixed number of rows, and a failed download now names the index and the URL and points to path (#311).
  • download_factor_library_grid() caches the grid of the factor library for the rest of the session, so download_factor_library_ids() and download_data("Tidy Finance", "factor_library", ...) no longer download the grid of more than four million rows on every call (previously twice per download_data() call when filtering). Use refresh = TRUE to download it again.
  • Passing a legacy identifier such as "factors_ff_3_monthly" as dataset now warns that this value is deprecated and names the dataset that replaces it, e.g. "Fama/French 3 Factors". The warning previously claimed that the type argument was used, although the caller never passed it.
  • estimate_fama_macbeth() now orders the cross-sections chronologically before aggregating them over time. Newey-West standard errors depend on the order of the time series, so the same data in a different row order previously returned different standard errors and t-statistics while the risk premia were unchanged. Results for chronologically sorted input are unaffected (#302).
  • The documentation of estimate_fama_macbeth(detail = TRUE) now lists the adj_r_squared column, which the function has always returned in summary_statistics alongside r_squared and n_obs.
  • download_data_stock_prices() now derives dates from the exchange time zone reported by Yahoo Finance instead of converting the timestamps in UTC. Timestamps refer to the market open in local time, so for exchanges ahead of UTC (e.g. "^AXJO", "^NZ50") every observation was previously dated one calendar day too early and could fall on a weekend.
  • download_data_stock_prices() now returns a range that is inclusive of both start_date and end_date for every exchange, matching the other download_data_*() functions. The range was previously delegated to Yahoo Finance's period1 / period2, which are resolved in the exchange's local time zone, so end_date was excluded for markets at or behind UTC but included for markets ahead of it.
  • download_factor_library_grid(), and with it download_data("Tidy Finance", "factor_library"), now reads portfolio_sort_grid.parquet by name instead of every Parquet file listed in the grid repo, which also holds one slice of the grid per sorting variable and the list of sorting variables. Reading the listing failed as soon as the repo held more than one Parquet file.
  • download_factor_library_ids(), and with it download_data("Tidy Finance", "factor_library"), no longer fails with "HTTP 404 Not Found" for IDs in a range of 1,000 IDs for which the factor library has no file because none of its portfolio sorts produced portfolios (e.g., IDs 833001 to 835000, which hold "rdcap" sorts with min_size_quantile = 0.2). Requested IDs without returns are absent from the result, as documented, and a warning now lists them; if none of the requested IDs has returns, the result is an empty tibble with all columns.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 4.8 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK14 OK2026-03-27
Show 2 earlier changesHide 2 earlier changes
  • ERROR13 OK, 1 ERROR2026-03-25
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.9.0
READMEYes · 513 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.9.0Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
62 (1 internal)includes a package overview page
Examples that run
47%25 run in a plain check · 14 only when donttest examples are enabled (R CMD check --as-cran) · 13 never run · 1 hold no code
Exported functions with examples
100%
Documented parameters
99%
Return-value docs
100%
Help pages citing references
18%

Downloads

10.5K
CRAN downloads in the past year
Rank #4,306 · ~29/day · ~873/mo
Daily download trend is not available in this view yet.
86830 days
2K90 days
10.5K1 year
Compare downloads with other packages →
Also on158 r2u7 autocran

Repository

27Stars
6Forks
1Open issues
1Open PRs
15Releases
1,265Commits
8Commit identities
financer
1,265 commits · Last activity 2026-10-23 · 0% stars, 30d · Default branch at 0.9.0.9009, ahead of CRAN 0.9.0 (checked 2026-10-22)
Responsiveness
How these are sampled
PRs merged (all time)
95%
Median days to close, 50 most recently updated closed issues
1
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-10-02 · 192026-09-14 · 27
PracticesBeta

11 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/tidy-finance/r-tidyfinance on 2026-10-22.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-21 · The repository has a site deploy workflow

pkgdown site last built 2026-10-21

Coverage (1)
Coverage reporting
Reproducibility and dev environment (1)
data-raw/
Show all practicesHide 2 practices
CRAN release process (1)
cran-comments.md
Lint, format, editor (2)
lintrLint workflow
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen 2026-03-20
    Pull request: opened by its own account
    Commits: 7 by its own account
  • Claude Codefirst seen 2026-03-25
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: .claude, CLAUDE.md
    Named in .gitignore: .claude, .claude/skills
    Pull request it wrote: opened by a project member
    Commits: 29 by its own account · at least 106 crediting it in the message
Models named in its commits
  • Claude Opus 5.530 commits · Oct 2026
  • Claude Opus 4.821 commits · May to Jun 2026
  • Claude Opus 515 commits · Jul to Oct 2026
  • Claude Opus 4.714 commits · May 2026
  • Claude Sonnet 4.69 commits · Mar to Apr 2026

3 more models not listed. Some of these counts are a minimum, because the search stopped before the oldest commits.

Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
20 external dependencies (excludes base and recommended)

Installing tidyfinance adds 40 packages (26 with compiled code, 28 MB of source tarballs). Heaviest: stringi 11 MB, RPostgres 1.4 MB, sandwich 1.4 MB.

Depends (1)
R >= 4.1
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (4)
Author, Maintainer since 0.1.0 (2024), Copyright holder
Author, Copyright holder
Author, Copyright holder
Contributor · added in 0.4.0
Releases (15)

Pick two releases to compare their code metrics.

  • 0.9.0Latest
    record
    2026-10-05 · current release · diff ↗ ·
    added 1 export
    download_data_fred_md
  • 0.8.0
    record
    2026-06-25 · diff ↗ ·
    removed 1 export
    validate_dates
    added 4 exports
    download_data_jkp, download_data_pastor_stambaugh, download_data_stambaugh_yuan, list_supported_jkp_factors
  • 0.7.0
    record
    2026-06-25 · diff ↗
  • 0.6.0
    record
    2026-05-31 · diff ↗ ·
    removed 1 export
    create_wrds_dummy_database
    added 6 exports
    download_data_pseudo_ccm_links, download_data_pseudo_compustat, download_data_pseudo_crsp, download_factor_library_grid, download_factor_library_ids, list_supported_datasets
  • 0.5.0
    record
    2026-05-12 · diff ↗ ·
    removed 4 exports
    add_lag_columns, disconnection_connection, download_data_factors, lag_column
    added 12 exports
    add_lagged_columns, compute_rolling_value, disconnect_connection, download_data_huggingface, download_data_risk_free, filter_options, filter_sorting_data, get_available_huggingface_files, implement_portfolio_sort, join_lagged_values, portfolio_sort_options, validate_dates
  • R
    R 4.6.0 released · 2026-04-24
  • 0.4.5
    record
    2026-01-08 · diff ↗
  • 0.4.4
    record
    2025-05-07 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • 0.4.3
    record
    2024-12-17 · diff ↗
  • 0.4.2
    record
    2024-12-02 · diff ↗ ·
    added 1 export
    add_lag_columns
  • 0.4.1
    record
    2024-09-04 · diff ↗ ·
    removed 1 export
    download_data_wrds_clean_trace
    added 1 export
    download_data_wrds_trace_enhanced
  • 0.4.0
    record
    2024-08-30 · diff ↗ ·
    removed 2 exports
    download_data_stocks, download_data_stocks_yf
    added 13 exports
    breakpoint_options, compute_breakpoints, compute_long_short_returns, compute_portfolio_returns, data_options, download_data_constituents, download_data_fred, download_data_osap, download_data_stock_prices, estimate_betas, estimate_fama_macbeth, lag_column, list_supported_indexes
  • 0.3.0
    record
    2024-07-23 · diff ↗ ·
    added 2 exports
    download_data_stocks, download_data_stocks_yf
  • 0.2.1
    record
    2024-07-03 · diff ↗
  • 0.2.0
    record
    2024-05-29 · diff ↗ ·
    added 1 export
    set_wrds_credentials
Show 3 earlier eventsHide 3 earlier events
  • R
    R 4.4.0 released · 2024-04-24
  • 0.1.0
    record
    2024-03-05
  • R
    R 4.3.0 released · 2023-04-21

Package metadata

First published
2024-03-05
Total releases
15 / 2 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1
Download size
237 KB

Cite

Cite this package

Run in R for the authors' entry:

citation("tidyfinance")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1201/b23237.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for tidyfinance version 0.9.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy