Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with R 4.1 #277

Merged
merged 3 commits into from
Dec 27, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ License: GPL (>= 3)
URL: https://larmarange.github.io/broom.helpers/, https://github.com/larmarange/broom.helpers
BugReports: https://github.com/larmarange/broom.helpers/issues
Depends:
R (>= 4.2)
R (>= 4.1)
Imports:
broom (>= 0.8),
cards,
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- variable labels are now returned by `model_list_variables()` for `svycoxph`
models (#275)
- compatibility with R version 4.1 minimum (#276)

# broom.helpers 1.17.0

Expand Down
11 changes: 5 additions & 6 deletions R/model_identify_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
#' ) |>
#' model_identify_variables()
#'
#' iris |>
#' lm(
#' Sepal.Length ~ poly(Sepal.Width, 2) + Species,
#' data = _,
#' contrasts = list(Species = contr.sum)
#' ) |>
#' lm(
#' Sepal.Length ~ poly(Sepal.Width, 2) + Species,
#' data = iris,
#' contrasts = list(Species = contr.sum)
#' ) |>
#' model_identify_variables()
model_identify_variables <- function(model) {
UseMethod("model_identify_variables")
Expand Down
25 changes: 12 additions & 13 deletions R/model_list_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,19 @@
#' ) |>
#' model_list_variables()
#'
#' iris |>
#' lm(
#' Sepal.Length ~ poly(Sepal.Width, 2) + Species,
#' data = _,
#' contrasts = list(Species = contr.sum)
#' ) |>
#' model_list_variables()
#'
#' glm(
#' response ~ poly(age, 3) + stage + grade * trt,
#' na.omit(gtsummary::trial),
#' family = binomial,
#' lm(
#' Sepal.Length ~ poly(Sepal.Width, 2) + Species,
#' data = iris,
#' contrasts = list(Species = contr.sum)
#' ) |>
#' model_list_variables()
#' model_list_variables()
#'
#' glm(
#' response ~ poly(age, 3) + stage + grade * trt,
#' na.omit(gtsummary::trial),
#' family = binomial,
#' ) |>
#' model_list_variables()
#' }
model_list_variables <- function(model, labels = NULL,
only_variable = FALSE, add_var_type = FALSE) {
Expand Down
11 changes: 5 additions & 6 deletions man/model_identify_variables.Rd

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

25 changes: 12 additions & 13 deletions man/model_list_variables.Rd

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

7 changes: 3 additions & 4 deletions tests/testthat/test-add_term_labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,10 @@
)
)

res <- gtsummary::trial |>
dplyr::select(response, `age at dx` = age, `drug type` = trt) |>
lm(
res <- lm(
response ~ `age at dx` + `drug type`,

Check warning on line 258 in tests/testthat/test-add_term_labels.R

View workflow job for this annotation

GitHub Actions / lint

file=tests/testthat/test-add_term_labels.R,line=258,col=6,[indentation_linter] Indentation should be 4 spaces but is 6 spaces.
data = _
data = gtsummary::trial |>
dplyr::select(response, `age at dx` = age, `drug type` = trt)
) |>
tidy_and_attach() |>
tidy_add_variable_labels(list(`age at dx` = "AGGGGGGGE")) |>
Expand Down
Loading