Skip to content

.extract_surv_time() should return 1-row tibble for single observation with interval or counting censoring #1025

Closed
@hfrick

Description

@hfrick

It currently returns a vector instead of the 1-row tibble.

times <- seq(1, 100, length.out = 5)
times2 <- seq(100, 200, length.out = 5)
events <- c(1, 0, 1, 0, 1)

intv_c <- survival::Surv(times, times2, events, type = "interval")
count_c <- survival::Surv(times, times2, events)

parsnip:::.extract_surv_time(intv_c[1])
#> time1 time2 
#>     1     1
parsnip:::.extract_surv_time(count_c[1])
#> start  stop 
#>     1   100

Created on 2023-11-13 with reprex v2.0.2

Metadata

Metadata

Assignees

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions