Giter VIP home page Giter VIP logo

Comments (6)

MarcinKosinski avatar MarcinKosinski commented on August 22, 2024

@kassambara I've received such user experience

from survminer.

kassambara avatar kassambara commented on August 22, 2024

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")

rplot

# 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)

rplot13

Should we add a new argument "linetype.manual = c(1,1,2,1,2,2)" in ggsurvplot()?

Best,
A.

from survminer.

MarcinKosinski avatar MarcinKosinski commented on August 22, 2024

It's always easier than modyfing ggsurvplot$plot :)

2016-05-30 16:49 GMT+02:00 Alboukadel KASSAMBARA [email protected]:

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")

[image: rplot]
https://cloud.githubusercontent.com/assets/3313355/15652320/b720e3ce-2685-11e6-93fc-b4586b76ebaa.png

Change linetypes manuallyggsurv <- ggsurvplot(fit, linetype = "strata")ggsurv$plot <- ggsurv$plot + scale_linetype_manual(values = c(1,1,2,1,2,2))

print(ggsurv)

[image: rplot13]
https://cloud.githubusercontent.com/assets/3313355/15652401/3a8c7ef8-2686-11e6-8c4c-d59768088510.png

Should we add a new argument "linetype.manual = c(1,1,2,1,2,2)" in
ggsurvplot()?

Best,
A.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#45 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AGdaztldnibQ2KitZGgFqk4VXZvxEddyks5qGvkJgaJpZM4Ip1yF
.

from survminer.

kassambara avatar kassambara commented on August 22, 2024

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").

from survminer.

MarcinKosinski avatar MarcinKosinski commented on August 22, 2024

from survminer.

MarcinKosinski avatar MarcinKosinski commented on August 22, 2024

b50ca68

1609980

After you'll update NEWS.md you can close this issue

from survminer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.