Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Apr 29, 2024
2 parents 7c0bb41 + eb5ed46 commit 9cb1c08
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ pkgdown
# others
^renv$
^renv\.lock$
^.revdeprefs\.yaml$
^revdep$
^\.covrignore$
23 changes: 23 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ jobs:
checking Rd .usage sections .* NOTE
checking for unstated dependencies in vignettes .* NOTE
checking top-level files .* NOTE
r-cmd-non-cran:
name: R CMD Check (non-CRAN) 🧬
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
enforce-note-blocklist: true
publish-unit-test-report-gh-pages: false
junit-xml-comparison: false
concurrency-group: non-cran
disable-unit-test-reports: true
skip-r-cmd-install: true
note-blocklist: |
checking dependencies in R code .* NOTE
checking R code for possible problems .* NOTE
checking examples .* NOTE
checking Rd line widths .* NOTE
checking S3 generic/method consistency .* NOTE
checking Rd .usage sections .* NOTE
checking for unstated dependencies in vignettes .* NOTE
checking top-level files .* NOTE
coverage:
name: Coverage 📔
uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main
Expand Down Expand Up @@ -77,6 +98,8 @@ jobs:
uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@main
with:
auto-update: false
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
grammar:
if: github.event_name != 'push'
name: Grammar Check 🔤
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CLA 🔏

on:
issue_comment:
types:
- created
# For PRs that originate from forks
pull_request_target:
types:
- opened
- closed
- synchronize

jobs:
CLA:
name: CLA 📝
uses: insightsengineering/.github/.github/workflows/cla.yaml@main
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/on-demand.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: On-demand 🧑‍🔬

on:
schedule:
- cron: '45 3 * * 0'
workflow_dispatch:

jobs:
revdepcheck:
name: revdepcheck ↩️
uses: insightsengineering/r.pkg.template/.github/workflows/revdepcheck.yaml@main
13 changes: 2 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ on:
workflow_dispatch:

jobs:
build:
name: Build package 🎁
needs: release
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
skip-r-cmd-check: true
skip-r-cmd-install: true
docs:
name: Pkgdown Docs 📚
needs: release
Expand All @@ -36,8 +27,8 @@ jobs:
uses: insightsengineering/r.pkg.template/.github/workflows/release.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
r-cmd:
name: R CMD Check 🧬
build:
name: Build package and reports 🎁
needs: [release, docs]
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
secrets:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ temp/


.pre-commit-config.yaml
tests/testthat/_snaps/**/*.new.md
tests/testthat/_snaps/**/*.new.svg
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cardx
Title: Extra Analysis Results Data Utilities
Version: 0.1.0.9028
Version: 0.1.0.9030
Authors@R: c(
person("Daniel", "Sjoberg", , "[email protected]", role = c("aut", "cre")),
person("Abinaya", "Yogasekaram", , "[email protected]", role = "aut"),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cardx 0.1.0.9028
# cardx 0.1.0.9030

### Breaking Changes

Expand Down
6 changes: 3 additions & 3 deletions R/ard_survey_svycontinuous.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ accepted_svy_stats <- function(expand_quantiles = TRUE) {

# if no by variable, calculate univariate statistics
if (is_empty(by)) {
args$x <- stats::reformulate(variable)
args$x <- reformulate2(variable)
# calculate statistic (and remove FUN from the argument list)
stat <-
cards::eval_capture_conditions(
Expand Down Expand Up @@ -244,8 +244,8 @@ accepted_svy_stats <- function(expand_quantiles = TRUE) {

# if there is by variable(s), calculate statistics for the combinations
else {
args$formula <- stats::reformulate(variable)
args$by <- stats::reformulate(by)
args$formula <- reformulate2(variable)
args$by <- reformulate2(by)
stat <-
if (stat_name %in% c("median", paste0("p", 0:100))) {
cards::eval_capture_conditions(
Expand Down
2 changes: 1 addition & 1 deletion R/ard_survey_svyranktest.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ard_survey_svyranktest <- function(data, by, variables, test, ...) {
variable = variable,
lst_tidy =
cards::eval_capture_conditions(
survey::svyranktest(stats::reformulate(by, response = variable), design = data, test = test, ...) |>
survey::svyranktest(reformulate2(termlabels = by, response = variable), design = data, test = test, ...) |>
broom::tidy()
)
)
Expand Down
2 changes: 1 addition & 1 deletion R/ard_survey_svyttest.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ard_survey_svyttest <- function(data, by, variables, conf.level = 0.95, ...) {
variable = variable,
lst_tidy =
cards::eval_capture_conditions(
survey::svyttest(stats::reformulate(by, response = variable), design = data, ...) %>%
survey::svyttest(reformulate2(termlabels = by, response = variable), design = data, ...) %>%
# a slightly enhanced tidier that allows us to specify the conf.level
{
dplyr::bind_cols(
Expand Down
7 changes: 7 additions & 0 deletions revdep/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
checks
library
checks.noindex
library.noindex
cloud.noindex
data.sqlite
*.html

0 comments on commit 9cb1c08

Please sign in to comment.