I ran the below code chunk from a fresh start from within RStudio
and get a Error in View : subscript out of bounds
error when trying to use View
. The issue appears to be with viewing the Surv
objects ("censored data" where the exact value is represented by a range rather than an exact number).
library(survival)
df <- data.frame(id = c(1:10)
, cen1_lo = c(0, 0, 2, 0, 2, 6, 2, 0, 2, 2)
, cen1_hi = c(6, 0, 6, 0, 2, 6, 2, 0, 6, 3)
, cen2_lo = c(1, 1, 3, 2, 3, 6, 1, 3, 1, 0)
, cen2_hi = c(6, 3, 6, 2, 4, 6, 2, 5, 6, 3))
df$cen1 <- Surv(df$cen1_lo, df$cen1_hi, type = "interval2")
df$cen2 <- Surv(df$cen2_lo, df$cen2_hi, type="interval2")
View(df)
The View(df)
to view the data frame yields an Error in View : subscript out of bounds
; however, utils::View(df)
works normally. (I'm using the rstudio 2022.02.2+485 Prairie Trillium (desktop)).
What is the strategy to correct this issue within RStudio?