Closed QIU-Hongxiang-David closed 1 year ago
In some functions, when subsetting a data frame with only one column, drop=FALSE probably needs to be added to avoid getting a vector. For example, in the following call in the function survSL.weibreg:
drop=FALSE
survSL.weibreg
fit.weibreg <- survival::survreg(survival::Surv(time[time > 0], event[time > 0]) ~ ., data = X[time > 0,], weights = obsWeights[time > 0], dist = 'weibull')
data = X[time > 0,] might need to be changed to data = X[time > 0, , drop = FALSE] to deal with the case where X is a data frame with only one column.
data = X[time > 0,]
data = X[time > 0, , drop = FALSE]
X
Similar issues might occur in other SL wrappers as well.
Thanks, I hopefully fixed this issue.
In some functions, when subsetting a data frame with only one column,
drop=FALSE
probably needs to be added to avoid getting a vector. For example, in the following call in the functionsurvSL.weibreg
:data = X[time > 0,]
might need to be changed todata = X[time > 0, , drop = FALSE]
to deal with the case whereX
is a data frame with only one column.Similar issues might occur in other SL wrappers as well.