-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linetype is not vectorized #45
Comments
@kassambara I've received such user experience |
Hi, Linetypes can be changed by strata as follow: # Fit sur vival curves
library(survival)
lung$fake_groups <- sample(1:6, size = nrow(lung), replace = TRUE)
fit<- survfit(Surv(time, status) ~ fake_groups, data = lung)
# Visualize and change linetypes by strata
library(survminer)
ggsurvplot(fit, linetype = "strata") # Change linetypes manually
ggsurv <- ggsurvplot(fit, linetype = "strata")
ggsurv$plot <- ggsurv$plot + scale_linetype_manual(values = c(1,1,2,1,2,2))
print(ggsurv) Should we add a new argument "linetype.manual = c(1,1,2,1,2,2)" in ggsurvplot()? Best, |
It's always easier than modyfing ggsurvplot$plot :) 2016-05-30 16:49 GMT+02:00 Alboukadel KASSAMBARA notifications@github.com:
|
The function 'ggsurvplot()' has now a new argument linetype. Allowed values includes i) "strata" for changing linetypes by strata (i.e. groups); ii) a numeric vector (e.g., c(1, 2)) or a character vector c("solid", "dashed"). |
impressive pace
|
Dear Marcin
I have a question about the survminer package. I am new to R, and not sure where to ask questions, I hope you can help or redirect me.
Expected behavior
I have a survival object based on 6 groups. The following code creates 6 survival curves with ggsurvplot.
I can change the color of each line individual – but not the linetype? I thought I could write:
Actual behavior
However, this creates an error:
Can you explain me why “linetype” do not work in the same way as “palette”
Steps to reproduce the problem
session_info()
Cheers
Nikolaj
The text was updated successfully, but these errors were encountered: