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

1.2.1 Release #177

Merged
merged 104 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
b8c9018
Replace ellipsis unpacking with list to rlang::list2
mstackhouse Nov 7, 2023
e9148a3
Add test referenced in #111
mstackhouse Nov 7, 2023
19143da
remove unnecessary comment.
mstackhouse Dec 14, 2023
081f62d
Merge pull request #148 from atorus-research/gh_issue_111
mstackhouse Dec 14, 2023
3d463fa
Have R CMD check run on PRs & pushed to devel
asbates Dec 14, 2023
33df5cc
Documentation updates and typo corrections
ShiyuC Dec 14, 2023
ae5b9cf
Function in ticks
ShiyuC Dec 14, 2023
dcfaab0
Typo corrections in test
ShiyuC Dec 14, 2023
44f15bc
Add fix to convert infs to NAs for more expected result
mstackhouse Dec 14, 2023
08a6195
Update documentation to explain the change.
mstackhouse Dec 14, 2023
8a9546d
remove extra line
mstackhouse Dec 14, 2023
1bde2a5
Merge pull request #156 from atorus-research/gh_issue_87
mstackhouse Dec 14, 2023
8dfda81
Merge pull request #157 from atorus-research/gh_issue_134_150_v2
mstackhouse Dec 14, 2023
ecf617f
Add example
ShiyuC Dec 14, 2023
8aa428f
Merge pull request #158 from atorus-research/gh_issue_152
asbates Dec 14, 2023
a30dd2e
Merge pull request #159 from atorus-research/gh_issue_74
asbates Dec 14, 2023
2055a8d
Fix for #154
mstackhouse Dec 15, 2023
1daabae
Need to export set_format_strings.shift_layer
mstackhouse Dec 15, 2023
64a0dc2
Merge pull request #161 from atorus-research/gh_issue_154
asbates Dec 15, 2023
1ee5839
Add object type asserssion
ShiyuC Dec 15, 2023
4601d34
error message update
ShiyuC Dec 15, 2023
0f01ebc
Function and tests for #129
mstackhouse Dec 15, 2023
1f26ff6
vignette updates and clean up R CMD check notes
mstackhouse Dec 15, 2023
2ba6619
Added a test for object check
ShiyuC Dec 15, 2023
49ebf7a
object name update
ShiyuC Dec 15, 2023
7b3e995
move data sets from vignettes directory to included in the package
asbates Dec 15, 2023
1b56858
Update tests/testthat/test-collapse_row_labels.R
mstackhouse Dec 18, 2023
5e5d244
Update R/collapse_row_labels.R
mstackhouse Dec 18, 2023
9a17f5c
Merge pull request #163 from atorus-research/gh_issue_129
mstackhouse Dec 18, 2023
bb2dc13
Merge pull request #162 from atorus-research/gh_issue_147
mstackhouse Dec 18, 2023
ad619ea
Remove unnecessary and untested complexity from assertions
mstackhouse Dec 18, 2023
660ce73
Merge branch 'devel' into gh_issue_62
asbates Dec 18, 2023
46c5b67
prefix data sets with 'tplyr'
asbates Dec 18, 2023
bda673f
fix dataset name in vignette
asbates Dec 18, 2023
f079b7b
Fix README and add note on data
mstackhouse Dec 18, 2023
9f56997
Update pkgdown entries
mstackhouse Dec 18, 2023
7cf5e60
Fix vignette example
mstackhouse Dec 18, 2023
5e1dcf2
Merge pull request #164 from atorus-research/gh_issue_62
mstackhouse Dec 18, 2023
0ff347d
Merge branch 'devel' of github.com:atorus-research/Tplyr into gh_issu…
mstackhouse Dec 18, 2023
8829b8f
Remove code and functions that are unused/obsolete
mstackhouse Dec 18, 2023
d82b791
Unnecessary test
mstackhouse Dec 18, 2023
dc10e6e
Error message update
mstackhouse Dec 18, 2023
46456b7
update to dev version
mstackhouse Dec 19, 2023
f23701d
Merge pull request #169 from atorus-research/dev_version_update
elimillera Dec 19, 2023
791ef79
fix bolding
mstackhouse Dec 19, 2023
57cbe56
Add new contributors to description
mstackhouse Dec 19, 2023
268a623
Add replace_leading_whitespace function
mstackhouse Dec 19, 2023
4a94429
Updated for #170
mstackhouse Dec 19, 2023
7e6732d
test file
mstackhouse Dec 19, 2023
48f133c
old files
mstackhouse Dec 19, 2023
a5516fa
allow a scratch file
mstackhouse Dec 19, 2023
8314175
can't seem to remember to include all the files I need to include.
mstackhouse Dec 19, 2023
e22b671
Merge pull request #171 from atorus-research/gh_issue_170
asbates Dec 20, 2023
81e489f
I'm ashamed.
mstackhouse Jan 11, 2024
1c3a3a1
Resolve #146
mstackhouse Jan 26, 2024
ce21427
Resolve #166
mstackhouse Jan 26, 2024
4d39052
Dead code and small test fix
mstackhouse Jan 26, 2024
d277c9c
Update documentation to add note relavent to #160
mstackhouse Jan 26, 2024
a163d09
Merge pull request #172 from atorus-research/gh_issue_146
mstackhouse Jan 27, 2024
eb248e0
Initial addition of data limiting function
mstackhouse Feb 1, 2024
9e15574
Separate to genericized function, add test file
mstackhouse Feb 2, 2024
5ae408c
Finish count layer basic testing
mstackhouse Feb 2, 2024
52e9acf
Push development fixes for #173
mstackhouse Feb 5, 2024
a7a5365
I think I fixed this nightmare.
mstackhouse Feb 5, 2024
753124a
Last update and test added.
mstackhouse Feb 6, 2024
cc615e7
Handle nested counts properly
mstackhouse Feb 6, 2024
c9d46fd
Add data limiting for shift layers
mstackhouse Feb 6, 2024
f96c66b
Add documentation and convert adpe to a built-in dataset.
mstackhouse Feb 7, 2024
d741739
Push development for missing subs
mstackhouse Feb 8, 2024
208c13c
Unreachable code - this is legacy from denom refactor
mstackhouse Feb 8, 2024
111d90d
Bindings for add missing subs
mstackhouse Feb 8, 2024
0f5b146
push development
mstackhouse Feb 8, 2024
0bb5023
save so I can compare
mstackhouse Feb 8, 2024
c9904b7
namespace
mstackhouse Feb 8, 2024
963aeb5
I don't actually see what changed here?
mstackhouse Feb 8, 2024
aeb9843
iron out nuance and sorting for subject counts
mstackhouse Feb 8, 2024
b017955
Bring up to date with gh_issue_84 to avoid further conflicts
mstackhouse Feb 8, 2024
54d5c1b
gh_issue_84 merge
mstackhouse Feb 8, 2024
89de295
gh_issue_84 merge
mstackhouse Feb 8, 2024
c6d4b34
Merge branch 'gh_issue_83' of github.com:atorus-research/Tplyr into g…
mstackhouse Feb 8, 2024
a9cc893
start testing and push progress
mstackhouse Feb 8, 2024
4834120
Finishing testing and remaining updates
mstackhouse Feb 9, 2024
dc2e92c
R CMD check updates
mstackhouse Feb 9, 2024
8d70c50
Update comments
mstackhouse Feb 12, 2024
b261356
PR review comments.
mstackhouse Feb 13, 2024
fe6d7bb
Merge pull request #174 from atorus-research/gh_issue_84
mstackhouse Feb 14, 2024
6c54838
Merge branch 'devel' into gh_issue_155
mstackhouse Feb 14, 2024
836e169
Merge pull request #167 from atorus-research/gh_issue_155
mstackhouse Feb 14, 2024
bd85990
Documentation updates, news updates, and cran comments updates
mstackhouse Feb 14, 2024
e08ceea
link fix
mstackhouse Feb 14, 2024
10f09a1
ignore scratch file
mstackhouse Feb 14, 2024
806f9a0
update CRAN comments.
mstackhouse Feb 14, 2024
ee39004
Merge pull request #176 from atorus-research/release_prep_1-2-0
mstackhouse Feb 14, 2024
eca35a1
handling of metadata for missing subject rows
mstackhouse Feb 15, 2024
edbbd81
cran submission
mstackhouse Feb 15, 2024
3da13c7
Vignette, print test, and associated updates
mstackhouse Feb 16, 2024
0e354d3
Update pkgdown for new functions
mstackhouse Feb 16, 2024
caf4595
Increment version
mstackhouse Feb 16, 2024
a0cf280
Update R/meta.R
mstackhouse Feb 19, 2024
1ec836d
Update vignettes/metadata.Rmd
mstackhouse Feb 19, 2024
343f99e
Update PR comments
mstackhouse Feb 19, 2024
2208913
Merge pull request #179 from atorus-research/gh_issue_178
mstackhouse Feb 19, 2024
002a446
update news
mstackhouse Feb 19, 2024
8405704
CRAN comments and leftover doc update
mstackhouse Feb 19, 2024
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
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
^Makefile$
^Jenkinsfile$
^rsconnect$
^data-raw$
^scratch.R$
^CRAN-SUBMISSION$
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- main
- master
- devel
pull_request:
branches:
- main
- master
- devel

name: R-CMD-check

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
inst/doc
Tplyr.Rproj
docs/
scratch.R
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 1.2.0
Date: 2024-02-14 17:07:48 UTC
SHA: 806f9a0a103059542437632f5977cc1e8ded2652
15 changes: 14 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Tplyr
Title: A Traceability Focused Grammar of Clinical Data Summary
Version: 1.1.0
Version: 1.2.1
Authors@R:
c(
person(given = "Eli",
Expand All @@ -26,6 +26,18 @@ Authors@R:
family = "Mascary",
email = "sadchla.mascary@atorusresearch.com",
role = "ctb"),
person(given = "Andrew",
family = "Bates",
email = "andrew.bates@atorusresearch.com",
role = "ctb"),
person(given = "Shiyu",
family = "Chen",
email = "shiyu.chen@atorusresearch.com",
role = "ctb"),
person(given = "Oleksii",
family = "Mikryukov",
email = "alex.mikryukov@atorusresearch.com",
role = "ctb"),
person(given = "Atorus Research LLC",
role = "cph")
)
Expand Down Expand Up @@ -62,3 +74,4 @@ VignetteBuilder: knitr
RoxygenNote: 7.2.3
RdMacros: lifecycle
Config/testthat/edition: 3
LazyData: true
19 changes: 18 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ S3method(set_denoms_by,count_layer)
S3method(set_denoms_by,shift_layer)
S3method(set_format_strings,count_layer)
S3method(set_format_strings,desc_layer)
S3method(set_format_strings,shift_layer)
S3method(set_limit_data_by,count_layer)
S3method(set_limit_data_by,desc_layer)
S3method(set_limit_data_by,shift_layer)
S3method(set_where,tplyr_layer)
S3method(set_where,tplyr_table)
S3method(str,f_str)
Expand All @@ -40,10 +44,12 @@ S3method(str,tplyr_table)
export("%>%")
export("header_n<-")
export("pop_data<-")
export(add_anti_join)
export(add_column_headers)
export(add_filters)
export(add_layer)
export(add_layers)
export(add_missing_subjects_row)
export(add_risk_diff)
export(add_total_group)
export(add_total_row)
Expand All @@ -54,9 +60,11 @@ export(apply_conditional_format)
export(apply_formats)
export(apply_row_masks)
export(build)
export(collapse_row_labels)
export(f_str)
export(get_by)
export(get_count_layer_formats)
export(get_data_labels)
export(get_desc_layer_formats)
export(get_layer_template)
export(get_layer_templates)
Expand Down Expand Up @@ -86,6 +94,7 @@ export(process_statistic_data)
export(process_statistic_formatting)
export(process_summaries)
export(remove_layer_template)
export(replace_leading_whitespace)
export(set_by)
export(set_count_layer_formats)
export(set_custom_summaries)
Expand All @@ -97,7 +106,9 @@ export(set_distinct_by)
export(set_format_strings)
export(set_header_n)
export(set_indentation)
export(set_limit_data_by)
export(set_missing_count)
export(set_missing_subjects_row_label)
export(set_nest_count)
export(set_numeric_threshold)
export(set_order_count_method)
Expand Down Expand Up @@ -135,8 +146,10 @@ importFrom(dplyr,between)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,count)
importFrom(dplyr,cur_column)
importFrom(dplyr,cur_group)
importFrom(dplyr,desc)
importFrom(dplyr,distinct)
importFrom(dplyr,do)
importFrom(dplyr,everything)
Expand All @@ -159,10 +172,12 @@ importFrom(dplyr,rename)
importFrom(dplyr,row_number)
importFrom(dplyr,rowwise)
importFrom(dplyr,select)
importFrom(dplyr,slice_head)
importFrom(dplyr,summarize)
importFrom(dplyr,tally)
importFrom(dplyr,ungroup)
importFrom(dplyr,vars)
importFrom(dplyr,where)
importFrom(forcats,fct_collapse)
importFrom(forcats,fct_drop)
importFrom(forcats,fct_expand)
Expand All @@ -176,6 +191,7 @@ importFrom(purrr,flatten)
importFrom(purrr,imap)
importFrom(purrr,map)
importFrom(purrr,map2)
importFrom(purrr,map2_chr)
importFrom(purrr,map2_dfr)
importFrom(purrr,map_chr)
importFrom(purrr,map_dbl)
Expand All @@ -194,7 +210,6 @@ importFrom(rlang,as_name)
importFrom(rlang,call_args)
importFrom(rlang,call_modify)
importFrom(rlang,call_name)
importFrom(rlang,call_standardise)
importFrom(rlang,caller_env)
importFrom(rlang,current_env)
importFrom(rlang,enexpr)
Expand All @@ -220,6 +235,7 @@ importFrom(rlang,is_logical)
importFrom(rlang,is_named)
importFrom(rlang,is_quosure)
importFrom(rlang,is_quosures)
importFrom(rlang,list2)
importFrom(rlang,quo)
importFrom(rlang,quo_get_expr)
importFrom(rlang,quo_is_call)
Expand All @@ -245,6 +261,7 @@ importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_extract_all)
importFrom(stringr,str_locate_all)
importFrom(stringr,str_match)
importFrom(stringr,str_match_all)
importFrom(stringr,str_pad)
importFrom(stringr,str_remove_all)
Expand Down
18 changes: 18 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Tplyr 1.2.1
- Resolve #178 to add metadata handling for missing subjects, and add the `add_anti_join()` function

# Tplyr 1.2.0
- Resolve #62 Add data vignette data into the package (thanks for the suggestion @thebioengineer)
- Resolve #74 Add an example of piping in set_pop_data
- Resolve #83 Add the `add_missing_subjects()` function
- Resolve #84 Add `set_limit_data_by()` function
- Resolve #111, #148 Allow ellipsis argument unpacking outside of `add_layer()`
- Resolve #129 Add `collapse_row_labels()` function
- Resolve #134 Clarify how population data works to trigger denominators
- Resolve #75, #146, #166 Fix nested count layer handling where one inner layer value exists in multiple outer layer groups
- Resolve #21, #152 Fix handling of Inf, -Inf in desc layer for min and max
- Resolve #154 Fix namespace scoping for execution of Tplyr tables within non-global environments
- Resolve #155 Dead code clean-up
- Resolve #170 Add `replace_leading_whitespace()` post-processing function
- Resolve #173 Fix nested count layer sort variable behavior when using by variables

# Tplyr 1.1.0
- This release incorporate parenthesis hugging across all layers (#117)
- New functions `apply_conditional_formats()`, `str_extract_fmt_group()` and `str_extract_num()`
Expand Down
8 changes: 4 additions & 4 deletions R/apply_conditional_format.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
#' @noRd
validate_conditional_format_params <- function(string, format_group, condition, replacement, full_string) {
if (!inherits(string, "character")) {
stop("Paramter `string` must be a character vector", call.=FALSE)
stop("Parameter `string` must be a character vector", call.=FALSE)
}

if (!inherits(format_group, "numeric") || (inherits(format_group, "numeric") && format_group %% 1 != 0)) {
stop("Paramter `format_group` must be an integer", call.=FALSE)
stop("Parameter `format_group` must be an integer", call.=FALSE)
}

if (!inherits(replacement, "character")) {
stop("Paramter `replacement` must be a string", call.=FALSE)
stop("Parameter `replacement` must be a string", call.=FALSE)
}

# Condition statement must use the variable name 'x'
Expand All @@ -28,7 +28,7 @@ validate_conditional_format_params <- function(string, format_group, condition,
}

if (!inherits(full_string, "logical")) {
stop("Paramter `full_string` must be bool", call.=FALSE)
stop("Parameter `full_string` must be bool", call.=FALSE)
}

}
Expand Down
4 changes: 2 additions & 2 deletions R/apply_formats.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ apply_formats <- function(format_string, ..., empty = c(.overall = "")) {
call.=FALSE)
}

pmap_chr(list(...), function(...) apply_fmts(...), fmt=format)
pmap_chr(list2(...), function(...) apply_fmts(...), fmt=format)
}

#' Application of individual format string
Expand All @@ -53,7 +53,7 @@ apply_formats <- function(format_string, ..., empty = c(.overall = "")) {
#' @return An individually formatted string
#' @noRd
apply_fmts <- function(..., fmt) {
nums <- list(...)
nums <- list2(...)
repl <- vector('list', length(fmt$settings))
for (i in seq_along(fmt$settings)) {
repl[[i]] <- num_fmt(nums[[i]], i, fmt=fmt)
Expand Down
53 changes: 3 additions & 50 deletions R/assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,7 @@ assert_has_class <- function(x, should_be) {

# Is the argument the class that it should be?
if (class(x) != should_be){
# Grab the trace back into an object
trc <- trace_back()
# Look at the length of the traceback
max_length <- length(trc$calls)
# If it's >1 we're inside a function, so grab the name
if (max_length > 1){
# Pull the name out of the call stack
cname <- call_name(trc$calls[[max_length - 1]])
# Make a display string
func_str <- paste0('` in function `', cname, '`')
} else {
# Filler
func_str <- '`'
}
# Abort and show error
abort(paste0('Argument `', param, func_str, ' must be ',
abort(paste0('Argument `', param, '` must be ',
should_be, '. Instead a class of "', class(x),
'" was passed.'))
}
Expand All @@ -75,24 +60,9 @@ assert_inherits_class <- function(x, should_have) {

# Is the argument the class that it should be?
if (!inherits(x, should_have)){

# Grab the trace back into an object
trc <- trace_back()
# Look at the length of the traceback
max_length <- max(trc$indices)
# If it's >1 we're innside a function, so grab the name
if (max_length > 1){
# Pull the name out of the call stack
cname <- call_name(trc$calls[[max_length - 1]])
# Make a display string
func_str <- paste0('` in function `', cname, '`')
} else {
# Filler
func_str <- '`'
}
# Abort and show error
abort(paste0('Argument `', param, func_str,
' does not inherit "', should_have,
abort(paste0('Argument `', param,
'` does not inherit "', should_have,
'". Classes: ', paste(class(x), collapse=", ")))
}
}
Expand Down Expand Up @@ -197,15 +167,6 @@ unpack_vars <- function(quo_list, allow_character=TRUE) {
quo_list
}

#' Check if a quosure is null or contains a call
#'
#' @param quo_var A quosure object to check
#'
#' @noRd
is_null_or_call <- function(quo_var) {
quo_is_null(quo_var) || inherits(quo_get_expr(quo_var), "call")
}

#' Check if a quosure is null or contains a logical value
#'
#' @param quo_var A quosure object to check
Expand All @@ -222,14 +183,6 @@ assert_is_layer <- function(object) {
assert_inherits_class(object, "tplyr_layer")
}

#' @param object Object to check if its a layer
#'
#' @noRd
assert_is_table <- function(object) {
assert_inherits_class(object, "tplyr_table")
}


#' Return the class of the expression inside a quosure
#'
#' @param q A quosure
Expand Down
Loading
Loading