Skip to content

Codex/correctness and r interface - #10

Open
Macosso wants to merge 40 commits into
masterfrom
codex/correctness-and-r-interface
Open

Macosso wants to merge 40 commits into
masterfrom
codex/correctness-and-r-interface

Conversation

@Macosso

@Macosso Macosso commented Sep 15, 2026

Copy link
Copy Markdown
Owner

This pull request introduces a substantial set of improvements and new features to the csdm package, focusing on enhanced model extraction, updating, and summary methods, as well as more robust handling of missing data, subsetting, and time grid specification. It also improves the package's testing, documentation, and workflow automation. The most important changes are grouped below by theme.

Major new features and enhancements:

  • Added new S3 methods for csdm_fit objects, including tidy, glance, augment, update, model.frame, model.matrix, terms, formula, nobs, df.residual, and fitted, enabling better integration with the tidyverse and model summary tools. [1] [2]
  • Implemented robust model extraction and update logic: models now retain their evaluated subset, time spacing, missing-value policy, and time indexes when updated, and new accessors provide original-row outputs and stored-data updates. [1] [2] [3]
  • Added explicit support for subset, na.action, and time_step arguments to the main csdm function, improving control over data preprocessing and time grid construction. [1] [2] [3] [4]
  • Improved handling and validation of missing data, subsetting, and panel keys, including better error messages and preservation of original observation identity. [1] [2]

Statistical and computational improvements:

  • Enhanced calculation of fit statistics and R², including correct handling of intercepts and robust computation across missing data scenarios. [1] [2] [3]
  • Improved unit-level regression bookkeeping and error handling, with clearer reporting and validation of included/excluded units.

Infrastructure and workflow:

  • Expanded the list of imported and suggested packages to support new features, including generics, tibble, broom, sandwich, plm, lmtest, and modelsummary.
  • Updated the GitHub Actions workflow to test on both Ubuntu and Windows, improved dependency setup, and added new ignore patterns for development artifacts. [1] [2]
  • Updated documentation and news to reflect new features and changes. [1] [2]

Summary of most important changes:

1. Model extraction, updating, and S3 methods

  • Added S3 methods for csdm_fit objects: tidy, glance, augment, update, model.frame, model.matrix, terms, formula, nobs, df.residual, fitted, enabling easier model inspection, updating, and integration with other R tools. [1] [2]

2. Data handling and preprocessing

  • Introduced explicit subset, na.action, and time_step arguments to csdm(), allowing fine-grained control of estimation samples and time grids. [1] [2] [3] [4]
  • Improved preservation of original observation identity and validation of panel keys and missing data policies. [1] [2]

3. Statistical computation improvements

  • Enhanced fit statistics computation, including robust R² calculation with correct intercept handling and improved reporting of included/excluded units. [1] [2] [3] [4]

4. Package infrastructure and dependencies

  • Expanded package dependencies and suggestions to support new features and improved compatibility with the tidyverse and model summary tools.
  • Updated GitHub Actions workflow and .Rbuildignore for better cross-platform testing and development hygiene. [1] [2]

5. Documentation and news

  • Updated NEWS.md and documentation to describe new features, changes, and bug fixes. [1] [2]

Refreshes `renv/activate.R` to the newer renv bootstrap logic and behavior. This update adds safer project resolution via `RENV_PROJECT`, improved autoload gating for subprocesses, cache-aware bootstrap loading, broader GitHub token support, enhanced repository/header handling, and more robust JSON parsing/error handling during startup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant