Skip to content

Layout depends on RStudio windows size #45

@gernophil

Description

@gernophil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions