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

Use arrow to represent the big/small value for better visualization #17

Merged
merged 7 commits into from
Oct 2, 2019

Conversation

ShixiangWang
Copy link
Contributor

To fix #16, I read the source code and did some modification. I think it is better than the previous limits option.

devtools::install_github("ShixiangWang/forestmodel")

library(forestmodel)
library("survival")
library("dplyr")
pretty_lung <- lung %>%
  transmute(time,
            status,
            Age = age,
            Sex = factor(sex, labels = c("Male", "Female")),
            ECOG = factor(lung$ph.ecog),
            `Meal Cal` = meal.cal
  )

print(forest_model(coxph(Surv(time, status) ~ ., pretty_lung)))
# Use arrow to represent the big/small value
print(forest_model(coxph(Surv(time, status) ~ ., pretty_lung), 
                   limits = c(log(0.3), log(15))))



image

Best,
Shixiang

@NikNakk NikNakk self-requested a review October 2, 2019 20:24
@NikNakk NikNakk self-assigned this Oct 2, 2019
@NikNakk NikNakk merged commit 93ac681 into NikNakk:master Oct 2, 2019
@ShixiangWang
Copy link
Contributor Author

Thanks for accepting :). I added a site for this package, it will show info like https://shixiangwang.github.io/forestmodel/, you can set this in this repository setting, it will render https://niknakk.github.io/forestmodel/ automatically. I think this the best tool to create a forest plot I found, more examples and a vignette will help more R users know and use it. If you have spare time, you could try to add them.

Best,
Shixiang

@NikNakk
Copy link
Owner

NikNakk commented Oct 3, 2019

Thanks @ShixiangWang for your hard work! I've not used pkgdown before, but will add to the repository (and upload to CRAN) when I have time. I agree that a vignette would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to set limits and ticks
2 participants