以下是示例代码:
set.seed(2)
failure_time <- rexp(100)
status <- factor(sample(0:3, 100, replace=TRUE), 0:3,
c('no event', 'death', 'progression','other'))
disease <- factor(sample(1:6, 100,replace=TRUE), 1:6,
c('BRCA','LUNG','OV','CANCER','AIDS','HEART'))
fit <- cuminc(ftime = failure_time, fstatus = status,
group = disease)
ggcompetingrisks(fit)
R 自动生成一个 3 列、2 行的图。我希望将其排列为两列三行。有没有办法处理 ggcompetingrisks,或者我必须从头开始绘制所有内容?