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

Layout depends on RStudio windows size #45

Open
gernophil opened this issue Oct 12, 2023 · 0 comments
Open

Layout depends on RStudio windows size #45

gernophil opened this issue Oct 12, 2023 · 0 comments

Comments

@gernophil
Copy link

gernophil commented Oct 12, 2023

Hey everyone, I am creating a forestplot using the code at the bottom (I know a lot doesn't make sense for the lung data set, but I didn't wanna change to much). I also attached two screenshots. I ran the code using RStudio once with a maximized window and once with a very small one. The middle lane seems to change it's size depending on the window size. I think this shouldn't happen. Anyway to avoid this?

library(survival)
library(forestmodel)

uni_cols <- c("ph.ecog", "ph.karno", "pat.karno", "meal.cal", "wt.loss")

uni_formulas <- sapply(uni_cols,
                       function(x) as.formula(paste("Surv(time, status) ~ ", x)))

uni_models <- lapply(uni_formulas, function(x) {coxph(x, data = lung)})

uni_fm <- forest_model(model_list = uni_models,
                       merge_models = TRUE,
                       show_global_p = "aside",
                       format_options = forest_model_format_options(
                         colour = "black",
                         color = NULL,
                         shape = 15,
                         text_size = 4,
                         point_size = 4,
                         banded = TRUE
                       ))

ggsave("data/plots/covs/forest_uni_test.png",
       width = 21,
       height = 14.8,
       units = "cm")

forest_uni_big
forest_uni_small

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

No branches or pull requests

1 participant