Skip to content

stgam

1.2.1Package record

Spatially and Temporally Varying Coefficient Models Using Generalized Additive Models

0packages depend
3Kdownloads / year
–test coverage
13/13flavors OK

Overview

About

A framework for undertaking space and time varying coefficient models (varying parameter models) using a Generalized Additive Model (GAM) with smooths approach. The framework suggests the need to investigate for the presence and nature of any space-time dependencies in the data. It proposes a workflow that creates and refines an initial space-time GAM and includes tools to create and evaluate multiple model forms. The workflow sequence is to: i) Prepare the data by lengthening it to have a single location and time variables for each observation. ii) Create all possible space and/or time models in which each predictor is specified in different ways in smooths. iii) Evaluate each model via their AIC value and pick the best one. iv) Create the final model. v) Calculate the varying coefficient estimates to quantify how the relationships between the target and predictor variables vary over space, time or space-time. vi) Create maps, time series plots etc. The number of knots used in each smooth can be specified directly or iteratively increased. This is illustrated with a climate point dataset of the dry rain forest in South America. This builds on work in Comber et al (2024) doi:10.1080/13658816.2023.2270285 and Comber et al (2026) doi:10.1080/13658816.2026.2671964.

Changes in 1.2.1
  • update to main function (evaluate_models()) with fast GAM option using mgcv::bam
  • update to gam_model_rank() function to include k in the results

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 9.1 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-08
  • NOTE12 OK, 1 NOTE2026-06-07
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.2.1
READMEYes · 319 wordsVignettesYes · 2 · dynamicNEWSYes · 67% structured · mentions 1.2.1Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
6 (1 internal)includes a package overview page
Examples that run
80%4 run in a plain check · 1 never run
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
0%

Downloads

3K
CRAN downloads in the past year
Rank #10,447 · ~8/day · ~252/mo
Daily download trend is not available in this view yet.
Also on118 r2u2 autocran

Repository

7Stars
4Forks
1Open issues
2Open PRs
0Releases
164Commits
3Commit identities
164 commits · Last activity 2026-08-19
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
not measured
Median days to close, 50 most recently updated closed PRs
1

Commits over time

2026-07-19 · 1602026-08-23 · 164
PracticesBeta

3 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/lexcomber/stgam on 2026-10-25.

Continuous integration (2)
GitHub ActionsR CMD check workflow

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

Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
18 external dependencies (excludes base and recommended)

Installing stgam adds 21 packages (11 with compiled code, 17 MB of source tarballs). Heaviest: stringi 11 MB, vctrs 1.0 MB, dplyr 902 KB.

Depends (3)
R >= 4.1.0mgcvglue
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (4)
Author, Maintainer since 0.0.1.0 (2024)
Contributor
Contributor
Contributor · added in 1.2.0
Releases (9)

Pick two releases to compare their code metrics.

  • 1.2.1Latest
    record
    2026-08-19 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 1.2.0
    record
    2026-01-29 · diff ↗ ·
    added 1 export
    effect_size
  • 1.1.0
    record
    2025-08-27 · diff ↗
  • 1.0.2
    record
    2025-06-12 · diff ↗
  • 1.0.1
    record
    2025-06-07 · diff ↗
  • 1.0.0
    record
    2025-05-12 · diff ↗ ·
    removed 4 exports
    do_bma, gam_model_probs, plot_1d_smooth, plot_2d_smooth
    added 1 export
    gam_model_rank
  • R
    R 4.5.0 released · 2025-04-11
  • 0.0.1.2
    record
    2024-07-31 · diff ↗
  • 0.0.1.1
    record
    2024-07-12 · diff ↗
  • 0.0.1.0
    record
    2024-06-25
  • R
    R 4.4.0 released · 2024-04-24

Package metadata

First published
2024-06-25
Total releases
9 / 2 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1.0
Bundled data
26 KB / 1 file
Download size
3.3 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("stgam")
Comber, L., Brunsdon, C., Harris, P., & Irisarri, G. (2026). stgam: Spatially and Temporally Varying Coefficient Models Using Generalized Additive Models (Version 1.2.1) [Computer software]. https://doi.org/10.32614/CRAN.package.stgam

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

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 stgam version 1.2.1 [Data set]. HJJB, LLC. Data release v2026-10-26. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-26, 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