Closed mmaughan0 closed 6 months ago
In tab_surv_base
, your time
column has 15 elements, but you've declared the number of rows as 14.
This is an invalid / corrupt data frame, and there is nothing vctrs can do to support that. You'll need to fix that one on your end, or, if this data object came from another package, report the issue upstream to them
Thanks!
On Fri, Jan 12, 2024 at 9:25 AM Davis Vaughan @.***> wrote:
In tab_surv_base, your time column has 15 elements, but you've declared the number of rows as 14.
This is an invalid / corrupt data frame, and there is nothing vctrs can do to support that. You'll need to fix that one on your end, or, if this data object came from another package, report the issue upstream to them
— Reply to this email directly, view it on GitHub https://github.com/r-lib/vctrs/issues/1906#issuecomment-1889348327, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFEKOFJAHNLJAPZOAEX3OJ3YOFBXBAVCNFSM6AAAAABBOT2Y52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBZGM2DQMZSG4 . You are receiving this because you authored the thread.Message ID: @.***>
Reprex code: library(heemod) library(flexsurv) library(rgho) library(survival) library(ggplot2)
install.packages("survival") install.packages("survminer") install.packages("dpylr")
par_mod <- define_parameters(
age_base = 30*365,##cycle in this model is 1 day
age_cycle = model_time + age_base)
put more comments in code
par_mod <- define_parameters(
p_death_disease_base = compute_surv( fit_death_disease_base, time = state_time, km_limit = 14))
par_mod <- modify( par_mod,
p_death_disease_mAb = compute_surv( fit_death_disease_mAb, time = state_time, km_limit = 14))
tab_surv_base <- structure(list(time = c(1,1,2,3,5,5,6,6,7,7,8,9, 10, 14, 14 ), status = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L)), .Names = c("time", "status"), row.names = c(NA, -14L), class = "data.frame")
ggsurvplot(tab_surv_base)
Error: Error in
vec_slice()
: ! Columntime
(size 15) must match the data frame (size 14). ℹ In file slice.c at line 188. ℹ Install the winch package to get additional debugging info the next time you get this error. ℹ This is an internal error that was detected in the vctrs package. Please report it at https://github.com/r-lib/vctrs/issues with a reprex and the full backtrace. Backtrace: ▆<fn>
(...)