Convert object to a survival task (TaskSurv).
as_task_surv(x, ...)# S3 method for TaskSurv
as_task_surv(x, clone = FALSE, ...)
# S3 method for data.frame
as_task_surv(
x,
time = "time",
event = "event",
time2,
type = "right",
id = deparse(substitute(x)),
...
)
# S3 method for DataBackend
as_task_surv(
x,
time = "time",
event = "event",
time2,
type = "right",
id = deparse(substitute(x)),
...
)
# S3 method for formula
as_task_surv(x, data, id = deparse(substitute(data)), ...)
(any
)
Object to convert, e.g. a data.frame()
.
(any
)
Additional arguments.
(logical(1)
)
If TRUE
, ensures that the returned object is not the same as the input x
.
(character(1)
)
Name of the column for event time if data is right censored, otherwise starting time if
interval censored.
(character(1)
)
Name of the column giving the event indicator.
If data is right censored then "0"/FALSE
means alive (no event), "1"/TRUE
means dead
(event). If type
is "interval"
then "0" means right censored, "1" means dead (event),
"2" means left censored, and "3" means interval censored. If type
is "interval2"
then
event
is ignored.
(character(1)
)
Name of the column for ending time for interval censored data, otherwise ignored.
(character(1)
)
Name of the column giving the type of censoring. Default is 'right' censoring.
(character(1)
)
Id for the new task.
Defaults to the (deparsed and substituted) name of x
.
(data.frame()
)
Data frame containing all columns referenced in formula x
.