Skip to content

Instantly share code, notes, and snippets.

@RaphaelS1
Created April 17, 2021 09:24
Show Gist options
  • Save RaphaelS1/af71c30562157ae3b43dcb60cbf6e3f5 to your computer and use it in GitHub Desktop.
Save RaphaelS1/af71c30562157ae3b43dcb60cbf6e3f5 to your computer and use it in GitHub Desktop.
library(mlr3)
library(mlr3proba)
## get the `whas` task from mlr3proba
whas <- tsk("whas")
## create our own task from the rats dataset
rats_data <- survival::rats
## convert characters to factors
rats_data$sex <- factor(rats_data$sex, levels = c("f", "m"))
rats <- TaskSurv$new("rats", rats_data, time = "time", event = "status")
## combine in list
tasks <- list(whas, rats)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment