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

Merge devel into main for v0.2 #217

Merged
merged 95 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
d4af96a
CRAN badge added #174
barnett11 Jun 2, 2023
1284290
admiraldev version fixed #173
barnett11 Jun 2, 2023
06915c5
Added SDTM version tested on #171
barnett11 Jun 27, 2023
f935776
README updated for install.packages segment #177
barnett11 Jun 27, 2023
b7da780
Update Roxygen version #173
barnett11 Jun 27, 2023
1bcf4d8
Update lintr issues #173
barnett11 Jun 27, 2023
9fd31fb
Fix styler issues #173
barnett11 Jun 27, 2023
7e7143d
lintr issue fixed #173
barnett11 Jun 27, 2023
0e61b8d
style issue fixed #173
barnett11 Jun 27, 2023
0b3b023
Merge pull request #175 from pharmaverse/173_description
barnett11 Jul 31, 2023
cffa6f7
Merge branch 'devel' into 171_sdtm_ver
barnett11 Aug 1, 2023
05536ea
Add SDTMIG to WORDLIST #171
barnett11 Aug 1, 2023
777b6ff
lintr updates #171
barnett11 Aug 3, 2023
8c62b7b
Exclude lintr checks from tests/testthat #171
barnett11 Aug 3, 2023
5ee0c55
Revert lintr changes for styler recommendations #171
barnett11 Aug 3, 2023
c6c5d64
Merge pull request #176 from pharmaverse/171_sdtm_ver
barnett11 Aug 17, 2023
e5b7bdc
Merge in devel
barnett11 Aug 17, 2023
8ac462b
#182 Update with URL and BugReports
rossfarrugia Aug 21, 2023
c082676
Update the version number increment for next release
rossfarrugia Aug 21, 2023
99c49d4
#182 started 0.2.0 release changelog
rossfarrugia Aug 21, 2023
3f0eb4c
#182 added updated man file
rossfarrugia Aug 21, 2023
8895027
Update lintr issues raised #177
barnett11 Sep 25, 2023
ce32bf9
Reverse lintr update for styler #177
barnett11 Sep 25, 2023
a9088f7
Updating lintr and styler to renv #177
barnett11 Sep 25, 2023
924822b
Adds NEWS.md version notes #177
barnett11 Sep 25, 2023
29c233f
Fixing source link
alanaharris22 Sep 26, 2023
68a9661
Updating special_dm_cut and date_cut to account for the case that DCU…
alanaharris22 Oct 2, 2023
6e9407f
Reset renv.lock repos #177
barnett11 Oct 3, 2023
0c112c9
Merge pull request #178 from pharmaverse/177_install_segment
barnett11 Oct 4, 2023
8035f75
Merge branch 'devel' into 182_riskmetric
barnett11 Oct 9, 2023
77ada49
Fixing lint errors
alanaharris22 Oct 11, 2023
85871b1
Merge branch 'devel' into 179-allow-dcutdcutdtc-to-be-missing
alanaharris22 Oct 11, 2023
9f61f8d
Updating warning message.
alanaharris22 Oct 11, 2023
ae8afee
Update news file.
alanaharris22 Oct 12, 2023
7faba8a
Update news file.
alanaharris22 Oct 12, 2023
724a65d
Merge branch '179-allow-dcutdcutdtc-to-be-missing' of https://github.…
alanaharris22 Oct 12, 2023
91c217e
Merge pull request #183 from pharmaverse/182_riskmetric
barnett11 Oct 17, 2023
9106ca9
Merge branch 'devel' into 179-allow-dcutdcutdtc-to-be-missing
alanaharris22 Oct 17, 2023
8c9a7d0
Merge branch 'devel' into 184-bug-link-to-code-on-github-not-working
alanaharris22 Oct 17, 2023
94b22d4
Merge branch 'devel' into 184-bug-link-to-code-on-github-not-working
alanaharris22 Oct 17, 2023
975f019
Merge branch '184-bug-link-to-code-on-github-not-working' of https://…
alanaharris22 Oct 17, 2023
21abf9c
Merge branch '184-bug-link-to-code-on-github-not-working' into 179-al…
alanaharris22 Oct 17, 2023
b4d380f
Merge branch '184-bug-link-to-code-on-github-not-working' of https://…
alanaharris22 Oct 17, 2023
034ec41
Merge branch '184-bug-link-to-code-on-github-not-working' of https://…
alanaharris22 Oct 17, 2023
b34f6c3
Merge branch '184-bug-link-to-code-on-github-not-working' into 179-al…
alanaharris22 Oct 17, 2023
7e87ab1
Fixing lintr error
alanaharris22 Oct 17, 2023
97f2279
Merge branch 'main' into 184-bug-link-to-code-on-github-not-working
alanaharris22 Oct 31, 2023
3ebef49
Updating news file
alanaharris22 Oct 31, 2023
6721c11
Updated warning for expectation of dm naming for special_dm #172
barnett11 Nov 28, 2023
de2b7fd
Adjust style of message #172
barnett11 Nov 28, 2023
6e53a2b
Amend source data ref to source_sdtm_data #172
barnett11 Nov 28, 2023
0f8b06d
Updated impute_dcutdtc to allow missing data cutoff date
Nov 28, 2023
e5256d9
Merge pull request #186 from pharmaverse/184-bug-link-to-code-on-gith…
barnett11 Nov 29, 2023
3fad49f
merge in devel
barnett11 Nov 29, 2023
09d9974
Update pharmaverse links #172
barnett11 Nov 29, 2023
6de4ef3
Merge pull request #187 from pharmaverse/179-allow-dcutdcutdtc-to-be-…
barnett11 Dec 11, 2023
99a7dd5
merge in devel
barnett11 Dec 11, 2023
87d03d0
Update NEWS.md for process_cut warning addition #172
barnett11 Dec 11, 2023
ab85217
Merge pull request #191 from pharmaverse/172_dm_warning
alanaharris22 Dec 11, 2023
b95d4a5
Merged with devel
Dec 11, 2023
0a9bdad
Update PR template as per admiral #192
barnett11 Dec 12, 2023
f7370e0
Remove devel ref in links #192
barnett11 Dec 12, 2023
562d4be
Correct link reference to datacutr #192
barnett11 Dec 12, 2023
fcc27fa
Fix links from admiral #192
barnett11 Dec 12, 2023
ab5be7e
Updated roxygen2 version
Dec 12, 2023
0f1abed
Merge pull request #193 from pharmaverse/192_pr_template
alanaharris22 Dec 12, 2023
e0d1070
Merge branch 'devel' into 189-impute_dcutdtc-missing-dcutdtc
Dec 12, 2023
be7bfda
Merge pull request #194 from pharmaverse/189-impute_dcutdtc-missing-d…
alanaharris22 Dec 13, 2023
e579eec
Updating create_dcut() to allow for NA as a datacut date
alanaharris22 Dec 13, 2023
740b193
Updating test for create_dcut (NA should also be in date format)
alanaharris22 Dec 14, 2023
05e4ad1
Merge pull request #195 from pharmaverse/190-update-create_dcut-for-h…
barnett11 Jan 22, 2024
dfb5ae0
Assertion added for cut date not to be NULL #181
barnett11 Jan 26, 2024
bbed211
Add test for cut date being NULL #181
barnett11 Jan 26, 2024
a36c923
Update RoxygenNote to 7.3.1
barnett11 Jan 26, 2024
98f6455
Set RoxygenNote back to 7.2.3
barnett11 Jan 26, 2024
46db3bb
Added proposed updates to new branch, and added relevant create_dcut …
barnett11 Feb 5, 2024
c34f508
Fixed spellcheck issues #181 #196
barnett11 Feb 5, 2024
70f4f67
Merge pull request #197 from pharmaverse/181_nullcut
alanaharris22 Feb 9, 2024
cd8841c
process_cut updated so that the patient_cut_v, date_cut_m and no_cut_…
Mar 5, 2024
67d3391
Removed indentation_linter=NULL from the .lintr file
Mar 5, 2024
bb056a2
Added more detailed error message when incorrect datasets are fed int…
Mar 14, 2024
f5cc2c8
Updated to account for when more than one domain is mis-matching.
Apr 3, 2024
a62b115
Styled process_cut.R
May 16, 2024
290d205
Merge pull request #201 from pharmaverse/188-process_cut-null-defaults
reesnj Jun 7, 2024
e3d41f1
Closes 107 - read out (#202)
csandrews21 Jul 8, 2024
da1859b
Adding DT to renv.lock #203 (#205)
barnett11 Jul 30, 2024
cc9c4ae
Closes #206 pkgbuild issues (#207)
barnett11 Aug 1, 2024
77a0eb3
Update CICD from admiral #206 (#208)
barnett11 Aug 2, 2024
3d72083
Update minor spelling (#209)
barnett11 Aug 2, 2024
048a437
Add devel to cicd trigger (#210)
barnett11 Aug 2, 2024
6877633
Change RSPM ref to CRAN (#211)
barnett11 Aug 5, 2024
581379d
fix: No renv (#212)
cicdguy Aug 9, 2024
357434e
Set insert-tweak-page-hook: false for docs workflow (#215)
cicdguy Sep 2, 2024
70d7f33
Use `main` as default landing page (#216)
cicdguy Sep 6, 2024
6e1b066
Minor bump
barnett11 Oct 29, 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
1 change: 0 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
^.github$
^docs$
^.lintr$
^codecov\.yml$
^datacutr\.Rcheck$
^datacutr.*\.tar\.gz$
^datacutr.*\.tgz$
Expand Down
5 changes: 0 additions & 5 deletions .Rprofile

This file was deleted.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/05_onboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body:
- label: Given a tour of Github from a Core member
- label: Understand how to Create Issues and do a Pull Request
- label: Understand the Programming Strategy
- label: Read and understand [Developer Guides Articles](https://pharmaverse.github.io/admiral/cran-release/index.html)
- label: Read and understand [Developer Guides Articles](https://pharmaverse.github.io/admiral/CONTRIBUTING.html)
- label: Invited to all relevant meetings - Stand Ups, Retrospective, Sprint Planning, Question/Comments, Backlog, Community Meeting
- label: Given access to Box and relevant documents
- label: Given write access to Github Repository
Expand All @@ -33,7 +33,7 @@ body:
- label: Given a tour of Github from a Core member
- label: Understand how to Create Issues and do a Pull Request
- label: Understand the Programming Strategy
- label: Read and understand [Developer Guides Articles](https://pharmaverse.github.io/admiral/cran-release/index.html)
- label: Read and understand [Developer Guides Articles](https://pharmaverse.github.io/admiral/CONTRIBUTING.html)
- label: Invited to all relevant meetings - Question/Comments, Community Meeting
- label: Given write access to Github Repository
- label: Slack channel invites to admiral
Expand Down
10 changes: 5 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Thank you for your Pull Request! [admiraldev](https://pharmaverse.github.io/admiraldev/devel/index.html) have developed this task checklist from the [Development Process Guide](https://pharmaverse.github.io/admiraldev/main/articles/development_process.html) to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the datacutr codebase remains robust and consistent.
Thank you for your Pull Request! We have developed this task checklist from the [Development Process Guide](https://pharmaverse.github.io/admiral/CONTRIBUTING.html) to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the datacutr codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the `devel` branch until you have checked off each task.

- [ ] Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
- [ ] Code is formatted according to the [tidyverse style guide](https://style.tidyverse.org/). Run `styler::style_file()` to style R and Rmd files
- [ ] Updated relevant unit tests or have written new unit tests - See [Unit Test Guide](https://pharmaverse.github.io/admiraldev/main/articles/unit_test_guidance.html#writing-unit-tests-in-admiral-)
- [ ] If you removed/replaced any function and/or function parameters, did you fully follow the [deprecation guidance](https://pharmaverse.github.io/admiraldev/main/articles/programming_strategy.html#deprecation-1)?
- [ ] Update to all relevant roxygen headers and examples
- [ ] Updated relevant unit tests or have written new unit tests, which should consider realistic data scenarios and edge cases, e.g. empty datasets, errors, boundary cases etc. - See [Unit Test Guide](https://pharmaverse.github.io/admiraldev/articles/unit_test_guidance.html#tests-should-be-robust-to-cover-realistic-data-scenarios)
- [ ] If you removed/replaced any function and/or function parameters, did you fully follow the [deprecation guidance](https://pharmaverse.github.io/admiraldev/articles/programming_strategy.html#deprecation)?
- [ ] Update to all relevant roxygen headers and examples, including keywords and families. Refer to the [categorization of functions](https://pharmaverse.github.io/admiraldev/articles/programming_strategy.html#categorization-of-functions) to tag appropriate keyword/family.
- [ ] Run `devtools::document()` so all `.Rd` files in the `man` folder and the `NAMESPACE` file in the project root are updated appropriately
- [ ] Address any updates needed for vignettes and/or templates
- [ ] Update `NEWS.md` if the changes pertain to a user-facing function (i.e. it has an `@export` tag) or documentation aimed at users (rather than developers)
- [ ] Build datacutr site `pkgdown::build_site()` and check that all affected examples are displayed correctly and that all new functions occur on the "[Reference](https://pharmaverse.github.io/admiral/cran-release/reference/index.html)" page.
- [ ] Build datacutr site `pkgdown::build_site()` and check that all affected examples are displayed correctly and that all new functions occur on the "[Reference](https://pharmaverse.github.io/datacutr/main/reference/index.html)" page.
- [ ] Address or fix all lintr warnings and errors - `lintr::lint_package()`
- [ ] Run `R CMD check` locally and address all errors and warnings - `devtools::check()`
- [ ] Link the issue in the Development Section on the right hand side.
Expand Down
87 changes: 55 additions & 32 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Source: https://github.com/pharmaverse/admiralci
# Common workflows designed for Admiral
# but can be easily used by any other R package
name: Admiral Workflows
name: admiral CI/CD Workflows

on:
# 'workflow_dispatch' gives you the ability
Expand All @@ -11,19 +11,19 @@ on:
# 'push' events are triggered when commits
# are pushed to one of these branches
push:
tags:
- "v*"
branches:
- main
- patch
- devel
- pre-release
- test
# 'pull_request' events are triggered when PRs are
# created against one of these target branches.
pull_request:
branches:
- main
- patch
- devel
- pre-release
- test
# 'release' events are triggered when...
# you guessed it - when releases are made.
release:
Expand All @@ -35,77 +35,100 @@ concurrency:
group: admiral-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
R_VERSION: "release"

jobs:
get_r_version:
name: Get R version
runs-on: ubuntu-latest
outputs:
r-version: ${{ steps.get_r_version.outputs.R_VERSION }}
steps:
- name: Get R Version for Downstream Container Jobs
id: get_r_version
run: echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT
shell: bash
style:
name: Code Style
uses: pharmaverse/admiralci/.github/workflows/style.yml@main
if: github.event_name == 'pull_request'
needs: get_r_version
with:
r-version: "4.0"
r-version: "${{ needs.get_r_version.outputs.r-version }}"
spellcheck:
name: Spelling
uses: pharmaverse/admiralci/.github/workflows/spellcheck.yml@main
if: github.event_name == 'pull_request'
needs: get_r_version
with:
r-version: "4.0"
readme:
name: Render README
uses: pharmaverse/admiralci/.github/workflows/readme-render.yml@main
if: github.event_name == 'push'
with:
r-version: "4.0"
r-version: "${{ needs.get_r_version.outputs.r-version }}"
validation:
name: Validation
uses: pharmaverse/admiralci/.github/workflows/r-pkg-validation.yml@main
if: github.event_name == 'release'
needs: get_r_version
with:
r-version: "4.0"
r-version: "${{ needs.get_r_version.outputs.r-version }}"
check:
name: Check
uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main
with:
error-on: warning # TODO: find a way to ignore specific notes
if: github.event_name == 'pull_request'
docs:
name: Documentation
uses: pharmaverse/admiralci/.github/workflows/pkgdown.yml@main
if: github.event_name == 'push'
if: github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')
needs: get_r_version
with:
r-version: "4.0"
# Whether to skip multiversion docs
# Note that if you have multiple versions of docs,
# your URL links are likely to break due to path changes
r-version: "release"
skip-multiversion-docs: false
insert-tweak-page-hook: false
multiversion-docs-landing-page: main
secrets:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
linter:
name: Lint
uses: pharmaverse/admiralci/.github/workflows/lintr.yml@main
needs: get_r_version
if: github.event_name == 'pull_request'
with:
r-version: "4.0"
r-version: "${{ needs.get_r_version.outputs.r-version }}"
links:
name: Links
uses: pharmaverse/admiralci/.github/workflows/links.yml@main
if: >
github.event_name == 'push' || github.event_name == 'pull_request'
if: github.event_name == 'pull_request'
coverage:
name: Code Coverage
uses: pharmaverse/admiralci/.github/workflows/code-coverage.yml@main
if: >
github.event_name == 'push' || github.event_name == 'pull_request'
github.event_name != 'release'
needs: get_r_version
with:
r-version: "4.0"
r-version: "${{ needs.get_r_version.outputs.r-version }}"
# Whether to skip code coverage badge creation
# Setting to 'false' will require you to create
# an orphan branch called 'badges' in your repository
skip-coverage-badges: false
templates:
name: Check Templates
uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@main
if: >
github.event_name == 'push' || github.event_name == 'pull_request'
with:
r-version: "4.0"
man-pages:
name: Man Pages
uses: pharmaverse/admiralci/.github/workflows/man-pages.yml@main
if: github.event_name == 'pull_request'
needs: get_r_version
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
templates:
name: Check Templates
uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@main
secrets: inherit
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
needs: get_r_version
with:
r-version: "4.0"
r-version: "${{ needs.get_r_version.outputs.r-version }}"
vbump:
name: Version Bump 🤜🤛
if: github.event_name == 'push'
uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.PHARMAVERSE_BOT }}
12 changes: 10 additions & 2 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
linters: with_defaults(line_length_linter(100), object_usage_linter=NULL, cyclocomp_linter(complexity_limit = 20))
exclusions: list("R/data.R")
linters: linters_with_defaults(
line_length_linter(100),
object_usage_linter=NULL,
infix_spaces_linter=NULL,
indentation_linter=NULL,
cyclocomp_linter(complexity_limit = 22)
)
exclusions: list(
"R/data.R",
"tests/testthat")
18 changes: 11 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
Package: datacutr
Type: Package
Title: SDTM Datacut
Version: 0.1.0
Version: 0.2.0
Authors@R: c(
person("Tim", "Barnett", email = "[email protected]", role = c("cph","aut", "cre")),
person("Nathan", "Rees", email = "[email protected]", role = c("aut")),
person("Alana", "Harris", email = "[email protected]", role = c("aut")))
person("Alana", "Harris", email = "[email protected]", role = c("aut")),
person("Cara", "Andrews", email = "[email protected]", role = c("aut")))
Description: Supports the process of applying a cut to Standard Data Tabulation Model (SDTM),
as part of the analysis of specific points in time of the data, normally as part of
investigation into clinical trials. The functions support different approaches of
cutting to the different domains of SDTM normally observed.
License: Apache License (>= 2)
BugReports: https://github.com/pharmaverse/datacutr/issues
URL: https://pharmaverse.github.io/datacutr/, https://github.com/pharmaverse/datacutr
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.0
Depends: R (>= 3.5)
RoxygenNote: 7.3.2
Depends: R (>= 4.1)
Imports:
admiraldev,
admiraldev (>= 0.3.0),
assertthat (>= 0.2.1),
dplyr (>= 1.0.5),
lubridate (>= 1.7.4),
magrittr (>= 1.5),
purrr (>= 0.3.3),
stringr,
stringr (>= 1.4.0),
rlang (>= 0.4.4),
tibble
tibble (>= 3.0.0),
reactable (>= 0.4.4)
Suggests:
devtools,
lintr,
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export(impute_dcutdtc)
export(impute_sdtm)
export(process_cut)
export(pt_cut)
export(read_out)
export(special_dm_cut)
importFrom(admiraldev,assert_character_scalar)
importFrom(admiraldev,assert_data_frame)
Expand Down Expand Up @@ -36,12 +37,14 @@ importFrom(magrittr,"%>%")
importFrom(purrr,map)
importFrom(purrr,map_lgl)
importFrom(purrr,pmap)
importFrom(reactable,reactable)
importFrom(rlang,"!!")
importFrom(rlang,":=")
importFrom(rlang,as_quosures)
importFrom(rlang,enexpr)
importFrom(rlang,expr_name)
importFrom(rlang,exprs)
importFrom(rlang,is_named)
importFrom(rlang,is_quosure)
importFrom(rlang,quo_is_null)
importFrom(rlang,quo_name)
Expand Down
34 changes: 33 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# datacutr 0.2.0

## New Features
- Added a "Report a bug" link to `{datacutr}` website (#182)
- Added a `read_out` function that enables the generation of a read-out file (.html), to summarize changes applied to data during a datacut. (#107)

## Updates of Existing Functions
- Update to `impute_dcutdtc()`, `date_cut()` and `special_dm_cut()` functions to allow for
datacut date to be null. In this case, all records for this patient
will be kept/left unchanged. (#179, #189, #190)
- Warning added to `process_cut` if expected dataset `dm` is missing (#172)
- Warning added to `create_dcut` if cut date being passed as `NULL`,
and not valid date or `NA`/`""` (#181)
- `process_cut` updated so that the `patient_cut_v`, `date_cut_m` and `no_cut_v`
arguments have a default value of `NULL` (#188)
- `process_cut` updated to have more detailed error messages when incorrect datasets
are fed in (#180)
- `process_cut` updated to have arguments `read_out` and `out_path` to integrate the `read_out` function into the wrapper function; enabling auto-generation of the datacutr read-out file (#107)

## Breaking Changes
- Added dependency on `admiraldev` >= 0.3.0 (#173)
- Added dependency on R version >= 4.1 due to an update in `admiraldev` to use R native pipe

## Documentation
- Added notes on SDTM compatibility (#171)
- Cleaned install packages code format (#177)
- Fixed broken link to source (#184)
- Added report a bug link to site (#182)

## Various
- Added CRAN badge to site (#174)
- Pull Request template updated (#192)

# datacutr 0.1.0

## New Features
Expand All @@ -16,4 +49,3 @@
## Various
- N/A


14 changes: 12 additions & 2 deletions R/create_dcut.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @param ds_date_var Character date/time variable in the DS SDTMv to be compared against the
#' datacut date
#' @param filter Condition to filter patients in DS, should give 1 row per patient
#' @param cut_date Datacut date/time, e.g. "2022-10-22"
#' @param cut_date Datacut date/time, e.g. "2022-10-22", or NA if no date cut is to be applied
#' @param cut_description Datacut date/time description, e.g. "Clinical Cut Off Date"
#'
#' @author Alana Harris
Expand Down Expand Up @@ -62,6 +62,11 @@ create_dcut <- function(dataset_ds,
must be stored in ISO 8601 format."
)

# Check that cut date is not NULL
assert_that(!is.null(cut_date),
msg = "Cut date is NULL, please populate as NA or valid ISO8601 date format"
)

# Check that cut_date is in ISO 8601 format
valid_dtc <- is_valid_dtc(cut_date)
assert_that(valid_dtc,
Expand All @@ -74,13 +79,18 @@ create_dcut <- function(dataset_ds,
mutate(DCUTDTC = cut_date) %>%
mutate(DCUTDESC = cut_description) %>%
impute_dcutdtc(dsin = ., varin = DCUTDTC, varout = DCUTDTM) %>%
filter(., DCUTDTM >= DCUT_TEMP_DATE) %>%
filter(., (!is.na(DCUTDTM) & DCUTDTM >= DCUT_TEMP_DATE) | is.na(DCUTDTM)) %>%
filter_if(filter) %>%
subset(select = c(USUBJID, DCUTDTC, DCUTDTM, DCUTDESC))

assert_that(
(length(get_duplicates(dataset$USUBJID)) == 0),
msg = "Duplicate patients in the final returned dataset, please update."
)

# Print message if cut date is null
ifelse(any(is.na(mutate(dataset, DCUTDTM))) == TRUE,
print("At least 1 patient with missing datacut date."), NA
)
dataset
}
2 changes: 2 additions & 0 deletions R/datcutr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
#' syms pull if_else
#' @importFrom magrittr %>%
#' @importFrom rlang := quo_name !! is_quosure quo_is_null as_quosures exprs enexpr expr_name
#' is_named
#' @importFrom purrr map_lgl pmap map
#' @importFrom lubridate ymd_hms is.POSIXt
#' @importFrom admiraldev assert_symbol assert_data_frame assert_character_scalar assert_filter_cond
#' filter_if is_valid_dtc warn_if_invalid_dtc get_duplicates
#' @importFrom assertthat assert_that
#' @importFrom tibble tribble
#' @importFrom reactable reactable
#' @importFrom stringr str_match str_detect
"_PACKAGE"
Loading
Loading