Skip to content

Commit

Permalink
Merge branch 'main' into 261_truetype_pag_new
Browse files Browse the repository at this point in the history
Signed-off-by: Davide Garolini <[email protected]>
  • Loading branch information
Melkiades authored May 23, 2024
2 parents 194a7b7 + bdafa9d commit 21347e9
Show file tree
Hide file tree
Showing 24 changed files with 296 additions and 39 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ repos:
- methods
- checkmate
- htmltools
- lifecycle
- stats
- stringi
- id: use-tidy-description
Expand Down
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rtables
Title: Reporting Tables
Version: 0.6.7.9001
Date: 2024-05-02
Version: 0.6.7.9002
Date: 2024-05-13
Authors@R: c(
person("Gabriel", "Becker", , "[email protected]", role = "aut",
comment = "Original creator of the package"),
Expand Down Expand Up @@ -29,13 +29,14 @@ URL: https://github.com/insightsengineering/rtables,
https://insightsengineering.github.io/rtables/
BugReports: https://github.com/insightsengineering/rtables/issues
Depends:
R (>= 2.10),
formatters (>= 0.5.6),
magrittr (>= 1.5),
methods
methods,
R (>= 2.10)
Imports:
checkmate (>= 2.1.0),
htmltools (>= 0.5.4),
lifecycle (>= 0.2.0),
stats,
stringi (>= 1.6)
Suggests:
Expand All @@ -44,7 +45,6 @@ Suggests:
dplyr (>= 1.0.5),
flextable (>= 0.8.4),
knitr (>= 1.42),
lifecycle (>= 0.2.0),
officer (>= 0.5.0),
r2rtf (>= 0.3.2),
rmarkdown (>= 2.19),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ importFrom(formatters,export_as_pdf)
importFrom(formatters,export_as_txt)
importFrom(htmltools,tagList)
importFrom(htmltools,tags)
importFrom(lifecycle,deprecated)
importFrom(magrittr,"%>%")
importFrom(stats,binom.test)
importFrom(stats,na.omit)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## rtables 0.6.7.9001
## rtables 0.6.7.9002
### New Features
* Added `top_level_section_div` for `basic_table` to set section dividers for top level rows.
* Added `keep_label_rows` to `as_result_df` to have these lines visible.
Expand All @@ -15,6 +15,8 @@

### Miscellaneous
* Removed deprecated functions `add_analyzed_var` and `trim_zero_rows`.
* Added `lifecycle` badge files for documentation.
* Deprecated the `gap` and `check_headers` arguments to `rbindl_rtables` using `lifecycle`.

## rtables 0.6.6
### New Features
Expand Down
17 changes: 12 additions & 5 deletions R/colby_constructors.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ setGeneric(

#' @rdname int_methods
setMethod("split_rows", "NULL", function(lyt, spl, pos, cmpnd_fun = AnalyzeMultiVars) {
.Deprecated(msg = "Initializing layouts via NULL is deprecated, please use basic_table() instead")
lifecycle::deprecate_warn(
when = "0.3.8",
what = I("split_rows(NULL)"),
with = "basic_table()",
details = "Initializing layouts via `NULL` is no longer supported."
)
rl <- PreDataRowLayout(SplitVector(spl))
cl <- PreDataColLayout()
PreDataTableLayouts(rlayout = rl, clayout = cl)
Expand Down Expand Up @@ -208,10 +213,12 @@ setGeneric(

#' @rdname int_methods
setMethod("split_cols", "NULL", function(lyt, spl, pos) {
.Deprecated(msg = paste(
"Initializing layouts via NULL is deprecated,",
"please use basic_table() instead"
))
lifecycle::deprecate_warn(
when = "0.3.8",
what = I("split_cols(NULL)"),
with = "basic_table()",
details = "Initializing layouts via `NULL` is no longer supported."
)
cl <- PreDataColLayout(SplitVector(spl))
rl <- PreDataRowLayout()
PreDataTableLayouts(rlayout = rl, clayout = cl)
Expand Down
1 change: 1 addition & 0 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' @importFrom utils head head.matrix tail tail.matrix
#' @importFrom stats setNames na.omit prop.test binom.test relevel quantile
#' @importFrom htmltools tags tagList
#' @importFrom lifecycle deprecated
#' @importFrom magrittr %>%
#' @import methods
NULL
16 changes: 8 additions & 8 deletions R/tree_accessors.R
Original file line number Diff line number Diff line change
Expand Up @@ -3012,10 +3012,10 @@ setGeneric("col_fnotes_here", function(obj) standardGeneric("col_fnotes_here"))
#' @export
#' @rdname ref_fnotes
setMethod("col_fnotes_here", "ANY", function(obj) {
.Deprecated(
new = "col_footnotes",
old = "col_fnotes_here",
msg = "col_fnotes_here was deprecated in {rtables} version 0.6.5.9011. Please use col_footnotes instead."
lifecycle::deprecate_warn(
when = "0.6.6",
what = "col_fnotes_here()",
with = "col_footnotes()"
)
col_footnotes(obj)
})
Expand All @@ -3027,10 +3027,10 @@ setGeneric("col_fnotes_here<-", function(obj, value) standardGeneric("col_fnotes
#' @export
#' @rdname int_methods
setMethod("col_fnotes_here<-", "ANY", function(obj, value) {
.Deprecated(
new = "col_footnotes<-",
old = "col_fnotes_here<-",
msg = "col_fnotes_here<- was deprecated in {rtables} version 0.6.5.9011. Please use col_footnotes<- instead."
lifecycle::deprecate_warn(
when = "0.6.6",
what = I("col_fnotes_here()<-"),
with = I("col_footnotes()<-")
)
col_footnotes(obj) <- value
})
Expand Down
33 changes: 23 additions & 10 deletions R/tt_compatibility.R
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,18 @@ only_first_annot <- function(all_annots) {
#' @rdname rbind
#' @aliases rbind
#' @export
rbindl_rtables <- function(x, gap = 0, check_headers = TRUE) {
if (!check_headers) {
warning("check_headers = FALSE is no longer supported, ignoring.")
rbindl_rtables <- function(x, gap = lifecycle::deprecated(), check_headers = lifecycle::deprecated()) {
if (lifecycle::is_present(gap)) {
lifecycle::deprecate_warn(
when = "0.3.2",
what = "rbindl_rtables(gap)"
)
}
if (lifecycle::is_present(check_headers)) {
lifecycle::deprecate_warn(
when = "0.3.2",
what = "rbindl_rtables(check_headers)"
)
}

firstcols <- col_info(x[[1]])
Expand Down Expand Up @@ -507,7 +516,7 @@ rbindl_rtables <- function(x, gap = 0, check_headers = TRUE) {
setMethod(
"rbind", "VTableNodeInfo",
function(..., deparse.level = 1) {
rbindl_rtables(list(...), check_headers = TRUE)
rbindl_rtables(list(...))
}
)

Expand All @@ -530,7 +539,7 @@ setMethod(
setMethod(
"rbind2", "VTableNodeInfo",
function(x, y) {
rbindl_rtables(list(x, y), check_headers = TRUE)
rbindl_rtables(list(x, y))
}
)

Expand Down Expand Up @@ -926,7 +935,9 @@ chk_compat_cinfos <- function(tt1, tt2) {
}


#' **Deprecated:** Insert `rrow`s at (before) a specific location
#' Insert `rrow`s at (before) a specific location
#'
#' `r lifecycle::badge("deprecated")`
#'
#' This function is deprecated and will be removed in a future release of `rtables`. Please use
#' [insert_row_at_path()] or [label_at_path()] instead.
Expand Down Expand Up @@ -973,7 +984,11 @@ chk_compat_cinfos <- function(tt1, tt2) {
#' @export
insert_rrow <- function(tbl, rrow, at = 1,
ascontent = FALSE) {
.Deprecated("insert_row_at_path or label_at_path(tab)<-", old = "insert_rrow")
lifecycle::deprecate_warn(
when = "0.4.0",
what = "insert_rrow()",
with = I("insert_row_at_path() or label_at_path()")
)
stopifnot(
is(tbl, "VTableTree"),
is(rrow, "TableRow"),
Expand All @@ -985,9 +1000,7 @@ insert_rrow <- function(tbl, rrow, at = 1,
}

if (at == 1) {
return(rbindl_rtables(list(rrow, tbl),
check_headers = TRUE
))
return(rbindl_rtables(list(rrow, tbl)))
} else if (at == nrow(tbl) + 1) {
return(rbind2(tbl, rrow))
}
Expand Down
2 changes: 1 addition & 1 deletion R/tt_dotabulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ recursive_applysplit <- function(df,
#'
#' @inheritParams gen_args
#' @inheritParams lyt_args
#' @param col_counts (`numeric` or `NULL`)\cr `r lifecycle::badge("deprecated")` if non-`NULL`, column counts
#' @param col_counts (`numeric` or `NULL`)\cr if non-`NULL`, column counts
#' which override those calculated automatically during tabulation. Must specify "counts" for *all*
#' resulting columns if non-`NULL`. `NA` elements will be replaced with the automatically calculated counts.
#' @param col_total (`integer(1)`)\cr the total observations across all columns. Defaults to `nrow(df)`.
Expand Down
30 changes: 29 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
amongst
Bov<U+00E9>
CRAN's
Carreras
charset
Cheatsheet
Chohan
FFFL
Godwin
Heng
Hoffmann
Kelkhoff
Layouting
Lewandowski
Maximo
Modelling
NSE
Paszty
Pharma
Phuse
Pre
Qi
RStudio
Resync
Rua
STUDYID
Saibah
Stoilova
Subtable
Subtables
Tadeusz
Unstratified
Yung
amongst
charset
combinatorial
CRAN's
customizations
Expand All @@ -18,7 +47,6 @@ FFFL
flextable
formatter
funder
funs
getter
getters
Godwin
Expand Down
2 changes: 1 addition & 1 deletion man/build_table.Rd

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

21 changes: 21 additions & 0 deletions man/figures/lifecycle-archived.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-defunct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-deprecated.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-experimental.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions man/figures/lifecycle-maturing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 21347e9

Please sign in to comment.