Skip to content

Better error message when enrollment rate vectors are longer than T - minfup #117

@nanxstats

Description

@nanxstats

When the length of the enrollment rates vector gamma/R is accidentally set to be longer than T - minfup, for example:

library(gsDesign)

gsSurv(
  k = 2,
  test.type = 4,
  alpha = 0.025,
  beta = 0.1,
  astar = 0,
  timing = 0.75,
  sfu = sfLDOF,
  sfupar = c(0),
  sfl = sfHSD,
  sflpar = c(0),
  lambdaC = log(2)/20,
  hr = 0.65,
  hr0 = 1,
  eta = -log(1-0.02)/18,
  gamma = c(1, 6, 10, 20, 30),
  R = rep(1, 5),
  S = NULL,
  T = 12,
  minfup = 8,
  ratio = 1
)

This yields the cryptic error message:

Error in `rownames<-`(`*tmp*`, value = nameR) : 
  attempt to set 'rownames' on an object with no dimensions

Perhaps the reason is obvious (discrete time unit?), we should probably handle this exception in the logic explicitly.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions