benkeser / survtmle

Targeted Learning for Survival Analysis
https://benkeser.github.io/survtmle/
Other
20 stars 14 forks source link

broken examples #9

Closed nhejazi closed 7 years ago

nhejazi commented 7 years ago

Recent updates in the structure of package internals have caused the examples to break -- currently, devtools::check() exits with the following broken example:

R CMD check results
1 error  | 0 warnings | 0 notes
checking examples ... ERROR
Running examples in ‘survtmle-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: hazard_tmle
> ### Title: hazard_tmle
> ### Aliases: hazard_tmle
> 
> ### ** Examples
... 14 lines ...
> # fit hazard_tmle object with glm estimators for treatment, censoring, and failure
> fit1 <- hazard_tmle(ftime = ftime, ftype = ftype, trt = trt, adjustVars = adjustVars,
+ glm.trt = "W1 + W2", 
+ glm.ftime = "trt + W1 + W2", glm.ctime = "trt + W1 + W2", returnModels = TRUE)
Warning in max(dat$ftime[dat$trt == i]) :
  no non-missing arguments to max; returning -Inf
Warning in max(dat$ftime[dat$trt == i]) :
  no non-missing arguments to max; returning -Inf
Error in rep(1:nrow(dat), t0.mod) : invalid 'times' argument
Calls: hazard_tmle -> makeDataList -> [ -> [.data.frame -> sort
Execution halted
nhejazi commented 7 years ago

The above was fixed by aa2d037.

nhejazi commented 7 years ago

Another error persists:

R CMD check results
1 error  | 0 warnings | 0 notes
checking examples ... ERROR
Running examples in ‘survtmle-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: hazard_tmle
> ### Title: hazard_tmle
> ### Aliases: hazard_tmle
> 
> ### ** Examples
... 11 lines ...
> ftype <- round(runif(n,0,1))
> 
> #' # Fit 1
> # fit hazard_tmle object with glm estimators for treatment, censoring, and failure
> fit1 <- hazard_tmle(ftime = ftime, ftype = ftype, trt = trt, adjustVars = adjustVars,
+ glm.trt = "W1 + W2", 
+ glm.ftime = "trt + W1 + W2", glm.ctime = "trt + W1 + W2", returnModels = TRUE)
Error in stats::optim(par = rep(0, length(c(cleverCovariatesNotSelf, cleverCovariatesSelf))),  : 
  initial value in 'vmmin' is not finite
Calls: hazard_tmle -> fluctuateHazards -> <Anonymous>
Execution halted
nhejazi commented 7 years ago

The above error was fixed by b7b3ccf.

Closing for now -- builds passing on Travis-CI and Appveyor.