Skip to content
Closed
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: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pkgdown
^cran-comments\.md$
^\.covrignore$
^\.idea$
^lint_results.txt$
^dev$

# output
^output$
Expand Down
File renamed without changes.
42 changes: 42 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: release 🕰️

on:
pull_request:
types:
- opened
- ready_for_review
branches:
- main
push:
branches:
- main
workflow_dispatch:
inputs:
chosen-workflow:
description: |
Select which workflow you'd like to run
required: true
type: choice
default: rhub
options:
- rhub
- revdepcheck

jobs:
revdepcheck:
if: >
github.event_name == 'release' || (
github.event_name == 'workflow_dispatch' &&
inputs.chosen-workflow == 'revdepcheck'
)
name: revdepcheck ↩️
uses: johnsonandjohnson/junco/.github/workflows/revdepcheck.yaml@scda_test_reversedependency
rhub:
if: >
github.event_name == 'release' || (
github.event_name == 'workflow_dispatch' &&
inputs.chosen-workflow == 'rhub'
)
name: R-hub 🌐
uses: johnsonandjohnson/junco/.github/workflows/rhub.yaml@main
101 changes: 101 additions & 0 deletions .github/workflows/revdepcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
name: revdepcheck ⏪

on:
workflow_dispatch:
workflow_call:
secrets:
REPO_GITHUB_TOKEN:
description: |
Github token with read access to repositories, required for dependencies installation
required: false
inputs:
additional-env-vars:
description: |
Extra environment variables, as a 'key=value' pair, with each pair on a new line.
Example usage:
additional-env-vars: |
ABC=123
XYZ=456
required: false
default: ""
type: string
lookup-refs:
description: |
Passed to setup-r-dependencies action.
required: false
default: ""
type: string

jobs:
revdepcheck:
name: revdepcheck ⏪
runs-on: ubuntu-latest
if: >
!contains(github.event.commits[0].message, '[skip revdepcheck]')
&& github.event.pull_request.draft == false
container:
image: ghcr.io/insightsengineering/rstudio:latest

steps:
- name: Setup token 🔑
id: github-token
run: |
if [ "${{ secrets.REPO_GITHUB_TOKEN }}" == "" ]; then
echo "REPO_GITHUB_TOKEN is empty. Substituting it with GITHUB_TOKEN."
echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
else
echo "Using REPO_GITHUB_TOKEN."
echo "token=${{ secrets.REPO_GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Get branch names 🌿
id: branch-name
uses: tj-actions/branch-names@v9.0.0

- name: Checkout repo 🛎
uses: actions/checkout@v4.1.1
with:
ref: ${{ steps.branch-name.outputs.current_branch }}
fetch-depth: 1

- name: Restore cache 💰
uses: actions/cache@v4
with:
key: revdepcheck-${{ runner.os }}-${{ github.event.repository.name }}
path: |
~/.cache/R/pkgcache/pkg
~/.cache/R-crancache

- name: Check commit message 💬
run: |
git config --global --add safe.directory $(pwd)
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $head_commit_message"
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
echo "Skip instruction detected - cancelling the workflow."
exit 1
fi
shell: bash
env:
SKIP_INSTRUCTION: "[skip revdepcheck]"

- name: revdepcheck 🔄
id: revdepcheck
uses: insightsengineering/r-revdepcheck-action@main
with:
github-token: ${{ steps.github-token.outputs.token }}
additional-env-vars: ${{ inputs.additional-env-vars }}

- name: Prepare revdep artifact 🎁
run: |
rm -rf revdep/library.noindex
rm -rf revdep/library
shell: bash

- name: Upload artifact ⬆
uses: actions/upload-artifact@v4
with:
name: revdep
path: revdep/
2 changes: 2 additions & 0 deletions .revdeprefs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- insightsengineering/teal.modules.clinical
- insightsengineering/scda.test
16 changes: 9 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.4] - Unreleased
## [0.1.4.9] - Unreleased

### Added and Removed
- Added new behavior for nested `countsource` in h_a_freq_dataprep `altdf_subset` (#200)
- Add `geom_boxplot_j()` to be able to draw boxplots whose statistics follow SAS quantile(type =2)


## [0.1.4] - 2026-02-02

### Fixed
- "caption" paragraph style in the docx exporter is now handled by flextable (#182)
- Fixed `tt_to_tlgrtf()`, when exporting an empty listing do not lose Title and Footers
- Fixed `tt_to_tlgrtf()` argument `label_width_ins` which was not applying the change in the row label column width (#166).

### Changed
- Reinstate rbmi as dependency


## [0.1.3.9.1] - 2026-02-02

### Fixed
- Fixed `tt_to_tlgrtf()` argument `label_width_ins` which was not applying the change in the row label column width (#166).


## [0.1.3] - 2026-01-12

### Changed
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: junco
Title: Create Common Tables and Listings Used in Clinical Trials
Version: 0.1.4
Date: 2026-01-12
Version: 0.1.4.9
Date: 2026-03-11
Authors@R: c(
person("Gabriel", "Becker", , "gabembecker@gmail.com", role = c("cre", "aut"),
comment = "Original creator of the package, and author of included formatters functions"),
Expand Down
6 changes: 6 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export(find_missing_chg_after_avisit)
export(fit_ancova)
export(fit_mmrm_j)
export(format_stats)
export(geom_boxplot_j)
export(get_mmrm_lsmeans)
export(get_ref_info)
export(get_titles_from_file)
Expand Down Expand Up @@ -137,6 +138,11 @@ import(tidytlg)
importFrom(assertthat,assert_that)
importFrom(formatters,wrap_string_ttype)
importFrom(generics,tidy)
importFrom(ggplot2,GeomBoxplot)
importFrom(ggplot2,Stat)
importFrom(ggplot2,ggproto)
importFrom(ggplot2,layer)
importFrom(stats,quantile)
importFrom(stats,setNames)
importFrom(survival,Surv)
importFrom(survival,coxph)
Expand Down
9 changes: 1 addition & 8 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# junco 0.1.4
# junco 0.1.4.9


### Fixed
- "caption" paragraph style in the docx exporter is now handled by flextable (#182)
- Fixed `tt_to_tlgrtf()`, when exporting an empty listing do not lose Title and Footers
- Fixed `tt_to_tlgrtf()` argument `label_width_ins` which was not applying the change in the row label column width (#166).

### Changed
- Reinstate rbmi as dependency


15 changes: 9 additions & 6 deletions R/a_freq_j.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
#' It is a data frame in the higher row-space than the current input df
#' (which underwent row-splitting by the rtables splitting machinery).
#'
#' @param countsource Either `df` or `alt_df`.\cr
#' When `alt_df` the counts will be based upon the alternative dataframe `alt_df`.\cr
#' @param countsource Either `df`, `altdf`, or `altdf_subset`.\cr
#' When `altdf` the counts will be based upon the alternative dataframe `alt_df`.\cr
#' When `altdf_subset` the counts will be based upon `alt_df` but first restricted\cr
#' to the levels/values of the current row split for `.var` (or to `val` when provided).\cr
#' This is useful for subgroup processing,
#' to present counts of subjects in a subgroup from the alternative dataframe.
#'
Expand Down Expand Up @@ -86,15 +88,15 @@ s_freq_j <- function(
id = "USUBJID",
denom = c("n_df", "n_altdf", "N_col", "n_rowdf", "n_parentdf"),
.N_col,
countsource = c("df", "altdf")
countsource = c("df", "altdf", "altdf_subset")
) {
if (is.na(.var) || is.null(.var)) {
stop("Argument .var cannot be NA or NULL.")
}

countsource <- match.arg(countsource)

if (countsource == "altdf") {
if (countsource %in% c("altdf", "altdf_subset")) {
df <- alt_df
}

Expand Down Expand Up @@ -630,7 +632,7 @@ a_freq_j <- function(
extrablanklineafter = NULL,
restr_columns = NULL,
colgroup = NULL,
countsource = c("df", "altdf")
countsource = c("df", "altdf", "altdf_subset")
) {
denom <- match.arg(denom)
method <- match.arg(method)
Expand Down Expand Up @@ -679,7 +681,8 @@ a_freq_j <- function(
label_map = label_map,
.alt_df_full = .alt_df_full,
denom_by = denom_by,
.stats = .stats
.stats = .stats,
countsource = countsource
)
# res_dataprep is list with elements
# df .df_row val
Expand Down
Loading
Loading