Skip to content

Commit 980c134

Browse files
committed
Remove {rlang} to simplify NAMESPACE
1 parent 6714791 commit 980c134

3 files changed

Lines changed: 7 additions & 15 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: gsDesign2
22
Title: Group Sequential Design with Non-Constant Effect
3-
Version: 1.1.0.2
3+
Version: 1.1.0.3
44
Authors@R: c(
55
person("Keaven", "Anderson", email = "keaven_anderson@merck.com", role = c("aut")),
66
person("Yilong", "Zhang", email = "elong0527@gmail.com", role = c("aut")),
@@ -44,7 +44,6 @@ Imports:
4444
mvtnorm,
4545
npsurvSS,
4646
r2rtf,
47-
rlang,
4847
tibble,
4948
tidyr,
5049
utils,

R/globals.R

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,3 @@ utils::globalVariables(
112112
)
113113
)
114114
)
115-
116-
117-
# Workaround to remove `R CMD check` NOTE "All declared Imports should be used."
118-
# https://r-pkgs.org/dependencies-in-practice.html#how-to-not-use-a-package-in-imports
119-
ignore_unused_imports <- function() {
120-
rlang::`:=`
121-
}
122-
# Can't use `@importFrom rlang ":="` because it classes with data.table
123-
# https://github.com/r-lib/rlang/issues/1453

R/utility_tidy_tbl.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#' One-to-many table merge for presentation
2020
#'
2121
#' A table is desired based on a one-to-many mapping.
22-
#' The data frame in `table_a` maps into `table_b` with the by variable `by_a`
22+
#' The data frame in `table_a` maps into `table_b` with the by variable `byvar`
2323
#' Examples show how to use with the gt package for printing a compact combined table.
2424
#'
2525
#' @param table_a A data frame with one record for each value of `byvar`.
@@ -78,9 +78,11 @@ table_ab <- function(table_a, table_b, byvar, decimals = 1, aname = names(table_
7878
# Bind this together with the byvar column
7979
astring <- cbind(table_a %>% select(all_of(byvar)), astring)
8080
# Now merge with table_b
81-
ab <- left_join(astring, table_b, by = byvar) %>%
82-
select(-one_of(!!byvar)) %>%
83-
dplyr::rename(!!aname := !!"_alab")
81+
ab <- left_join(astring, table_b, by = byvar)
82+
# Remove column used for grouping
83+
ab[[byvar]] <- NULL
84+
# Use the new column name from the argument `aname`
85+
colnames(ab)[grep("_alab", colnames(ab))] <- aname
8486
return(ab)
8587
}
8688

0 commit comments

Comments
 (0)