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

Replace rlang::is_installed() with base::requireNamespace() #247

Merged
merged 2 commits into from
May 7, 2024

Conversation

jdblischak
Copy link
Collaborator

Closes #246

This PR removes the direct dependency on {rlang} by replacing rlang::is_installed() with base::requireNamespace(quietly = TRUE). I was originally going to create an internal function is_installed(), but even that seems uncessary since this code is always hidden from the user in the examples and vignettes.

I tested locally that requireNamespace() behaves as required:

remove.packages("dplyr")
library("simtrial")
requireNamespace("dplyr", quietly = TRUE)
.Last.value
## [1] FALSE
example("get_cut_date_by_event")
devtools::check(force_suggests = FALSE) # Sets _R_CHECK_FORCE_SUGGESTS_⁠ to FALSE
## N  checking package dependencies (11s)
##    Package suggested but not available for checking: 'dplyr'

xref: #245, Merck/gsDesign2#307, #195 (review), #201

@jdblischak jdblischak requested a review from nanxstats May 6, 2024 17:32
@jdblischak jdblischak self-assigned this May 6, 2024
Copy link
Contributor

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

vignettes/rmst.Rmd Outdated Show resolved Hide resolved
vignettes/routines.Rmd Outdated Show resolved Hide resolved
Remove duplication from copy-pasting

Co-authored-by: Yihui Xie <xie@yihui.name>
Copy link
Collaborator

@nanxstats nanxstats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks for restoring the dependency state to where it should be.

@nanxstats nanxstats merged commit 11fb5e2 into Merck:main May 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace rlang::is_installed() with a lightweight solution
3 participants