Skip to content

Commit

Permalink
refactor main runner function's name
Browse files Browse the repository at this point in the history
  • Loading branch information
qmarcou committed Jun 1, 2024
1 parent 6ba79a6 commit 12591c0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ S3method(print,TPreg)
S3method(summary,TPreg)
export(.filter_times)
export(compute_survprob_pch)
export(fit_netTPreg)
export(generate_exponential_time_to_event)
export(generate_poisson_time_to_event)
export(generate_uncensored_ind_exp_idm_data)
export(iddata)
export(invalid_argument)
export(multi_assert)
export(renewnetTPreg)
importFrom(data.table,":=")
importFrom(data.table,.BY)
importFrom(data.table,.EACHI)
Expand Down
2 changes: 1 addition & 1 deletion R/renewnetTPreg.R → R/fit_netTPreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ mod.glm.fit.callingwrapper <-
#' doi:10.1177/09622802211003608
#' @examples
#' # ADD_EXAMPLES_HERE
renewnetTPreg <- function(s = 0,
fit_netTPreg <- function(s = 0,
t = NULL,
trans,
formula,
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Now let's carry the of net survival estimation:
# Estimation can be sped up and carried in parrallel using futures:
future::plan("multisession") # will work on any OS
# future::plan("multicore") # more efficient but only works on UNIX systems
net_estimate <- renewnetTPreg(
net_estimate <- fit_netTPreg(
formula = ~1, # intercept only model, similar to Pohar-Perme estimation
data = crude_synth_idm_data,
# Use a standard ratetable
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Now let’s carry the of net survival estimation:
# Estimation can be sped up and carried in parrallel using futures:
future::plan("multisession") # will work on any OS
# future::plan("multicore") # more efficient but only works on UNIX systems
net_estimate <- renewnetTPreg(
net_estimate <- fit_netTPreg(
formula = ~1, # intercept only model, similar to Pohar-Perme estimation
data = crude_synth_idm_data,
# Use a standard ratetable
Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-netidmtpreg_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ testthat::test_that("IDM crude survival model estimates", {
estimates <- list()
for (transition in c("11", "12", "22", "13", "23")) {
estimates[transition] <-
renewnetTPreg(~1, synth_idm_data,
fit_netTPreg(~1, synth_idm_data,
ratetable = NULL,
rmap = NULL,
time_dep_popvars = NULL,
Expand Down Expand Up @@ -154,7 +154,7 @@ testthat::test_that("IDM Net survival model fitting runs inside futures", {
for (session_type in c("sequential", "multisession")){
future::plan(session_type)
for (transition in c("all", "11", "12", "22", "13", "23")) {
renewnetTPreg(
fit_netTPreg(
formula = ~1,
synth_idm_data,
# Use a standard ratetable
Expand Down Expand Up @@ -201,7 +201,7 @@ testthat::test_that("IDM Net survival fitting arguments handling", {

# vector-like t with adjusted_t gives is estimated at expected times
t <- c(1.3, 1.4, 1.5)
estim <- renewnetTPreg(
estim <- fit_netTPreg(
s = .5,
t = t,
trans = "11",
Expand All @@ -213,7 +213,7 @@ testthat::test_that("IDM Net survival fitting arguments handling", {
)
testthat::expect_equal(object = estim$co$time, expected = t)
testthat::expect_error( # large t in unadjusted vector of times
estim <- renewnetTPreg(
estim <- fit_netTPreg(
s = .5,
t = c(t, 1e5),
trans = "11",
Expand Down Expand Up @@ -275,7 +275,7 @@ population mortality are equal",
)

for (transition in c("11", "12", "22", "13", "23")) {
net_truth <- renewnetTPreg(
net_truth <- fit_netTPreg(
formula = ~1,
synth_idm_data,
# Use a standard ratetable
Expand All @@ -294,7 +294,7 @@ population mortality are equal",
R = 1 # Number of bootstraps
)

net_estimated <- renewnetTPreg(
net_estimated <- fit_netTPreg(
formula = ~1,
crude_synth_idm_data,
# Use a standard ratetable
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-plot.TPreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test_that("Plotting TPreg objects does not throw any error", {
# for (transition in c("11", "all")) {
for (transition in c("11")) {
estimate <-
renewnetTPreg(~1, synth_idm_data,
fit_netTPreg(~1, synth_idm_data,
ratetable = NULL,
rmap = NULL,
time_dep_popvars = NULL,
Expand All @@ -38,7 +38,7 @@ test_that("Plotting TPreg objects does not throw any error", {

# Check with more than just an intercept
estimate <-
renewnetTPreg(~sex, synth_idm_data,
fit_netTPreg(~sex, synth_idm_data,
ratetable = NULL,
rmap = NULL,
time_dep_popvars = NULL,
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-print.TPreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_that("Printing TPreg objects does not throw any error", {
)
for (transition in c("11", "all")) {
estimate <-
renewnetTPreg(~1, synth_idm_data,
fit_netTPreg(~1, synth_idm_data,
ratetable = NULL,
rmap = NULL,
time_dep_popvars = NULL,
Expand All @@ -37,7 +37,7 @@ test_that("Printing TPreg objects does not throw any error", {

# Check with more than just an intercept
estimate <-
renewnetTPreg(~sex, synth_idm_data,
fit_netTPreg(~sex, synth_idm_data,
ratetable = NULL,
rmap = NULL,
time_dep_popvars = NULL,
Expand Down

0 comments on commit 12591c0

Please sign in to comment.