Skip to contents

Convert object to a competing risks task (TaskCompRisks).

Usage

as_task_cmprsk(x, ...)

# S3 method for class 'TaskCompRisks'
as_task_cmprsk(x, clone = FALSE, ...)

# S3 method for class 'data.frame'
as_task_cmprsk(
  x,
  time = "time",
  event = "event",
  id = deparse(substitute(x)),
  ...
)

# S3 method for class 'DataBackend'
as_task_cmprsk(
  x,
  time = "time",
  event = "event",
  id = deparse(substitute(x)),
  ...
)

Arguments

x

(any)
Object to convert, e.g. a data.frame().

...

(any)
Additional arguments.

clone

(logical(1))
If TRUE, ensures that the returned object is not the same as the input x.

time

(character(1))
Name of the column for event time if data is right censored, otherwise starting time if interval censored.

event

(character(1))
Name of the column giving the event indicator. If data is right censored then 0 means alive (no event) and 1 means dead (event). If type is "interval" then event is ignored.

id

(character(1))
Id for the new task. Defaults to the (deparsed and substituted) name of x.