Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
RGL_USE_NULL: true

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
101 changes: 0 additions & 101 deletions .github/workflows/r.yml

This file was deleted.

4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# rdss 1.0.14

* deprecates tidy_stan in favor of new broom.mixed::tidy function

# rdss 1.0.12

* address bugs with future package
Expand Down
20 changes: 7 additions & 13 deletions R/helpers-stanreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,29 @@

#' Tidy results from a stanreg regression and exponentiate the estimated coefficient
#'
#' Note no standard errors or other summary statistics are provided
#' This function is deprecated. Please use the 'tidy' function from the 'broom.mixed' package.
#'
#' See https://book.declaredesign.org/choosing-an-answer-strategy.html#bayesian-formalizations
#'
#' @param x A stanreg fit from stan_glm
#' @param conf.int Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to FALSE.
#' @param conf.level The confidence level to use for the confidence interval if conf.int = TRUE. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval.
#' @param exponentiate Logical indicating whether or not to exponentiate the the coefficient estimates. Defaults to FALSE. Note that standard errors are not included when \code{exponentiate = TRUE}.
#' @param exponentiate Logical indicating whether or not to exponentiate the the coefficient estimates. Defaults to FALSE.
#' @param ... Other arguments to broom.mixed::tidy
#'
#' @return data.frame of results
#'
#' @export
tidy_stan <- function(x, conf.int = FALSE, conf.level = 0.95, exponentiate = FALSE, ...) {

message("This function is deprecated. Please use the 'tidy' function from the 'broom.mixed' package.")

if(!requireNamespace("broom.mixed")){
message("The tidy_exponentiate function requires the 'broom.mixed' package.")
message("The tidy_stan function requires the 'broom.mixed' package.")
return(invisible())
}

ret <- broom.mixed::tidy(x, conf.int = conf.int, conf.level = conf.level, ...)

if (exponentiate) {
ret$estimate <- exp(ret$estimate)
if("conf.low" %in% colnames(ret)){
ret$conf.low <- exp(ret$conf.low)
ret$conf.high <- exp(ret$conf.high)
}
ret$std.error <- NULL
}
ret <- broom.mixed::tidy(x, conf.int = conf.int, conf.level = conf.level, exponentiate = exponentiate, ...)

ret
}
4 changes: 2 additions & 2 deletions man/tidy_stan.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading