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

Add feedback from future devs #106

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- `WeibSurvOS` now does not return an error for large values of t.
- `PWCSurvOS` now does not return an error for large values of t. It also no longer returns values larger than 1. It is significantly faster, based on a closed form calculation instead of numerical integration.
- `getSimulatedData` now also works when there are no transitions from progression to death, similarly for `getOneClinicalTrial` (which now warns if there are no such transitions at all).
- `corPFSOS` now undoes the `future` plan upon function exit.

### Miscellaneous

Expand Down
3 changes: 2 additions & 1 deletion R/corPFSOS.R
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ corPFSOS <- function(data, transition, bootstrap = TRUE, bootstrap_n = 100, conf
trans <- estimateParams(data, transition)
res <- list("corPFSOS" = corTrans(trans))
if (bootstrap) {
future::plan(future::multisession, workers = max(1, parallelly::availableCores() - 1))
oplan <- future::plan(future::multisession, workers = parallelly::availableCores(omit = 1))
on.exit(future::plan(oplan), add = TRUE)
ids <- lapply(1:bootstrap_n, function(x) sample(seq_len(nrow(data)), nrow(data), replace = TRUE))
corBootstrap <- furrr::future_map_dbl(ids, ~ {
furrr::furrr_options(
Expand Down
Loading