Skip to content

rollshap

1.0.1

Rolling Shapley Values

0packages depend
845downloads / year
73.9%test coverage
13/13checks pass

Overview

About
Maintained by Jason FosterFirst published 2026-05-211 releasesCRAN page ↗GitHub ↗

Analytical computation of rolling and expanding Shapley values for time-series data. The 'rollshap' package decomposes the coefficient of determination (R-squared) of a linear regression into nonnegative contributions from each explanatory variable using the Shapley value from cooperative game theory (Shapley, 1953, doi:10.1515/9781400881970-018). For each window, the exact Shapley value is computed by fitting all subsets of the explanatory variables and averaging the marginal contribution to R-squared across all orderings, which returns an order-invariant attribution that sums to the full-model R-squared. Use cases include variable importance, factor attribution, and feature selection in time-series regression. The package supports rolling and expanding windows, weights, and handling of missing values via 'min_obs', 'complete_obs', and 'na_restore' arguments. The implementation uses the online and offline algorithms from the 'roll' package to compute rolling and expanding cross-products efficiently with parallelism across columns and windows provided by 'RcppParallel'.

Install

Health

CRAN checks
13OK
Slowest check: 2.3 min · r-oldrel-windows-x86_64
Code health
Yes
Tests · ratio 4.98
73.9%
Coverage · measured lines
100%
Documentation · exports
2
Dependencies · direct
Check history
  • OK2026-08-04
    13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • NOTE2026-08-01
    12 OK · 1 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
  • OK2026-05-22
    5 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE

Documentation

Documentation
READMEYes · 255 wordsVignettesNopkgdown siteNoNEWSNoCode of conductNoContributing guideNo
Examples that run
100%
Documented parameters
100%
Return-value docs
100%
References docs
0%

Downloads

845
CRAN downloads in the past year
Rank #11,767 · ~2/day · ~70/mo
Daily download trend is not available in this view yet.
17530 days
84590 days
8451 year
Compare downloads with other packages →
Also on65 r2u

Repository

Repository
3Stars
0Forks
0Open issues
0Open PRs
0Releases
43Commits
1Contributors
algorithmspackagerrcppshapley
43 commits · Last activity 2026-07-05

Stars over time

2024-05-04 · 32026-07-07 · 3

Repository practices

Upstream repositoryBeta

1 development-tooling and community-health practice detected across 1 family in the upstream repository

Checks run against github.com/jasonjfoster/rollshap on 2026-08-03.

Continuous integration (1)
GitHub Actions
How this is detected·Detection ruleset v1 (2026-07-18)

Dependencies

Declared dependencies
11 external dependencies (excludes base and recommended)
Depends (1)
R >= 3.0.2
Imports (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Code & Tests

People & History

People (1)
Maintainer (1)
Author, Maintainer
Authors (1)
Author, Maintainer
Package Timeline

1 release. R releases are shown for context.

  • 1.0.1Latest
    2026-05-21 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-05-21
Total releases
1 / 1 yrs
License
GPL (>= 2) OSI
Minimum R
≥ 3.0.2
Download size
not tracked yet
Installed size
not tracked yet
With dependencies
not tracked yet
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