Skip to content
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

Feature request: position_step() #6228

Open
teunbrand opened this issue Dec 10, 2024 · 5 comments · May be fixed by #6231
Open

Feature request: position_step() #6228

teunbrand opened this issue Dec 10, 2024 · 5 comments · May be fixed by #6231

Comments

@teunbrand
Copy link
Collaborator

We now have geom_step(). The 'step' adjustment to the line could in theory work with other geometries as well, notably geom_area() or even geom_ribbon(). The proposal here is to make a position_step() and deprecate GeomStep in favour of GeomLine + PositionStep.

@teunbrand
Copy link
Collaborator Author

I've come to realise that we could even generalise on the step adjustment by allowing arbitrary connections between points.

@smouksassi
Copy link

one consideration/complication for ribbons is how to close the last part of ribbon especially if it is a CI around say a geom_stop of a kaplan meier curves:
https://adibender.github.io/pammtools/reference/geom_stepribbon.html
https://github.com/smouksassi/ggquickeda/blob/main/R/ggkm.R#L750

@teunbrand
Copy link
Collaborator Author

teunbrand commented Dec 11, 2024

Thanks for the links @smouksassi! I have the feeling like I'm missing some subtlety here. Do KMCs have some special rules about how the steps should be drawn?

I think {ggsurvfit}, which I trust on their KMCs, uses direction = "hv" by default (https://github.com/pharmaverse/ggsurvfit/blob/main/R/stat_stepribbon.R).

@smouksassi
Copy link

harrelfe/rms#70
I will have to prepare something specific to KM, before deciding geom_kmbands I had to review what is available and what was different between the various solutions. from what I remember it is mainly the last point and how to close it that might be different between "methods"

@teunbrand
Copy link
Collaborator Author

teunbrand commented Dec 11, 2024

If we now already have 4 examples of packages had to reimplement the steps, then I suppose that indicates some need to support this at the base ggplot2 level beyond geom_step()😅

@teunbrand teunbrand linked a pull request Dec 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants