Skip to content

docs: add panel data example to summary-index.Rd#229

Closed
LeonidasZhak wants to merge 1 commit into
r-lib:mainfrom
LeonidasZhak:docs/panel-data-example
Closed

docs: add panel data example to summary-index.Rd#229
LeonidasZhak wants to merge 1 commit into
r-lib:mainfrom
LeonidasZhak:docs/panel-data-example

Conversation

@LeonidasZhak

Copy link
Copy Markdown

Summary

Adds a grouped rolling mean example to summary-index.Rd showing the most common Stata-to-R migration pattern for panel data.

Stata equivalent

rangestat (mean) roll_mean = sales, int(date -2 0) by(firm)

What the example demonstrates

  • Panel data with two firms and irregular dates (gaps in the series)
  • 3-day rolling mean within each firm using slide_index_mean()
  • Date-aware windows that correctly respect calendar gaps

Why this matters

This is the #1 migration question from Stata users adopting slider. Issue #193 asked about grouped sliding window operations. None of the existing examples in summary-index.Rd show grouped/panel data usage.

Validation

  • tools::checkRd('man/summary-index.Rd') passes (no output = no errors)
  • R CMD check passes clean (Status: OK)
  • All example code runs successfully in R
  • 2 files changed, 48 lines added

Files changed

File Lines Added Type
R/summary-index.R 24 Roxygen source
man/summary-index.Rd 24 Auto-generated Rd

Add a grouped rolling mean example showing the Stata-to-R migration
pattern for panel data. This is the most common use case for users
migrating from Stata's rangestat/bysort + rolling operations.

The example shows:
- Panel data with two firms and irregular dates
- 3-day rolling mean within each firm using slide_index_mean()
- Date-aware windows that respect gaps in the series

Related: r-lib#193
@LeonidasZhak

Copy link
Copy Markdown
Author

Withdrawing this small automated PR while I consolidate an oversized batch of contributions and reduce maintainer review burden. Sorry for the noise, and thank you for maintaining the project.

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