kassambara / survminer

Survival Analysis and Visualization
https://rpkgs.datanovia.com/survminer/
509 stars 164 forks source link

Isse with ggforest #590

Open GenOnyx opened 2 years ago

GenOnyx commented 2 years ago

Hi, I am trying to generate the forest plot for TCGA BRCA data. My data does not have any NA values (checked thoroughly).

The commands I am using are: bigmodel = coxph(Surv(time, event) ~ Gender + AJCC.Stage + Tumor, data = info) Call: coxph(formula = Surv(time, event) ~ Gender + AJCC.Stage + Tumor, data = info)

                       coef  exp(coef)   se(coef)      z        p

GenderMALE -1.551e+01 1.830e-07 3.125e+03 -0.005 0.996039 AJCC.StageStage I -1.520e+00 2.186e-01 5.849e-01 -2.599 0.009341 AJCC.StageStage IA -2.641e+00 7.126e-02 7.133e-01 -3.703 0.000213 AJCC.StageStage IB -1.261e+00 2.833e-01 1.084e+00 -1.164 0.244355 AJCC.StageStage II -1.633e+00 1.953e-01 7.492e-01 -2.180 0.029266 AJCC.StageStage IIA -1.467e+00 2.307e-01 5.648e-01 -2.597 0.009402 AJCC.StageStage IIB -1.557e+00 2.108e-01 6.319e-01 -2.463 0.013760 AJCC.StageStage III -1.504e+00 2.222e-01 9.006e-01 -1.670 0.094896 AJCC.StageStage IIIA -1.435e+00 2.380e-01 7.180e-01 -1.999 0.045594 AJCC.StageStage IIIB -1.130e+00 3.231e-01 9.268e-01 -1.219 0.222859 AJCC.StageStage IIIC 1.463e-01 1.158e+00 7.747e-01 0.189 0.850167 AJCC.StageStage IV -5.187e-01 5.953e-01 6.890e-01 -0.753 0.451568 AJCC.StageStage X -1.693e+01 4.448e-08 8.008e+03 -0.002 0.998313 TumorT2 -6.959e-02 9.328e-01 4.575e-01 -0.152 0.879101 TumorT3 -1.059e-01 8.995e-01 5.817e-01 -0.182 0.855506 TumorT4 -2.592e-01 7.716e-01 8.137e-01 -0.319 0.750045 TumorTX -1.341e+00 2.615e-01 8.280e-01 -1.620 0.105232

Likelihood ratio test=27.22 on 17 df, p=0.05489 n= 791, number of events= 85 (27 observations deleted due to missingness)

And then when I use the following command:

ggforest(bigmodel, data = info) Error in axisTicks(rangeb/2, log = TRUE, nint = 7) : log - axis(), 'at' creation, LARGE range: invalid {xy}axp or par; nint=7 axp[0:1]=(1e-307,1e+308), usr[0:1]=(0,inf); i=615, ni=87

Steps to reproduce the problem

session_info()

─ Session info ──────────────────────────────────────────────────────────────────────────── setting value version R version 4.1.1 (2021-08-10) os Ubuntu 20.04.4 LTS system x86_64, linux-gnu ui RStudio language en_IN:en collate en_IN.UTF-8 ctype en_IN.UTF-8 tz Asia/Kolkata date 2022-05-27 rstudio 1.4.1717 Juliet Rose (desktop) pandoc 2.5 @ /usr/bin/pandoc

─ Packages ──────────────────────────────────────────────────────────────────────────────── package version date (UTC) lib source abind 1.4-5 2016-07-21 [1] CRAN (R 4.1.1) assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.1.1) backports 1.4.1 2021-12-13 [1] CRAN (R 4.1.1) brio 1.1.3 2021-11-30 [1] CRAN (R 4.1.1) broom 0.8.0 2022-04-13 [1] CRAN (R 4.1.1) cachem 1.0.6 2021-08-19 [1] CRAN (R 4.1.1) callr 3.7.0 2021-04-20 [1] CRAN (R 4.1.1) car 3.0-12 2021-11-06 [1] CRAN (R 4.1.1) carData 3.0-5 2022-01-06 [1] CRAN (R 4.1.1) cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.1.1) cli 3.3.0 2022-04-25 [1] CRAN (R 4.1.1) colorspace 2.0-3 2022-02-21 [1] CRAN (R 4.1.1) cowplot 1.1.1 2020-12-30 [1] CRAN (R 4.1.1) crayon 1.5.1 2022-03-26 [1] CRAN (R 4.1.1) data.table 1.14.2 2021-09-27 [1] CRAN (R 4.1.1) DBI 1.1.2 2021-12-20 [1] CRAN (R 4.1.1) dbplyr 2.1.1 2021-04-06 [1] CRAN (R 4.1.1) desc 1.4.1 2022-03-06 [1] CRAN (R 4.1.1) devtools 2.4.3 2021-11-30 [1] CRAN (R 4.1.1) dplyr 1.0.9 2022-04-28 [1] CRAN (R 4.1.1) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.1) fansi 1.0.3 2022-03-24 [1] CRAN (R 4.1.1) fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.1.1) forcats 0.5.1 2021-01-27 [1] CRAN (R 4.1.1) fs 1.5.2 2021-12-08 [1] CRAN (R 4.1.1) generics 0.1.2 2022-01-31 [1] CRAN (R 4.1.1) ggplot2 3.3.5 2021-06-25 [1] CRAN (R 4.1.1) ggpubr 0.4.0 2020-06-27 [1] CRAN (R 4.1.1) ggsignif 0.6.3 2021-09-09 [1] CRAN (R 4.1.1) glue 1.6.2 2022-02-24 [1] CRAN (R 4.1.1) gridExtra 2.3 2017-09-09 [1] CRAN (R 4.1.1) gtable 0.3.0 2019-03-25 [1] CRAN (R 4.1.1) haven 2.5.0 2022-04-15 [1] CRAN (R 4.1.1) hms 1.1.1 2021-09-26 [1] CRAN (R 4.1.1) httr 1.4.2 2020-07-20 [1] CRAN (R 4.1.1) jsonlite 1.8.0 2022-02-22 [1] CRAN (R 4.1.1) km.ci 0.5-6 2022-04-06 [1] CRAN (R 4.1.1) KMsurv 0.1-5 2012-12-03 [1] CRAN (R 4.1.1) knitr 1.39 2022-04-26 [1] CRAN (R 4.1.1) lattice 0.20-45 2021-09-22 [1] CRAN (R 4.1.1) lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.1) lubridate 1.8.0 2021-10-07 [1] CRAN (R 4.1.1) magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.1.1) Matrix 1.4-1 2022-03-23 [1] CRAN (R 4.1.1) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.1.1) modelr 0.1.8 2020-05-19 [1] CRAN (R 4.1.1) munsell 0.5.0 2018-06-12 [1] CRAN (R 4.1.1) pillar 1.7.0 2022-02-01 [1] CRAN (R 4.1.1) pkgbuild 1.3.1 2021-12-20 [1] CRAN (R 4.1.1) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.1) pkgload 1.2.4 2021-11-30 [1] CRAN (R 4.1.1) prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.1.1) processx 3.5.3 2022-03-25 [1] CRAN (R 4.1.1) ps 1.7.0 2022-04-23 [1] CRAN (R 4.1.1) purrr 0.3.4 2020-04-17 [1] CRAN (R 4.1.1) R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.1) readr 2.1.2 2022-01-30 [1] CRAN (R 4.1.1) readxl 1.4.0 2022-03-28 [1] CRAN (R 4.1.1) remotes 2.4.2 2021-11-30 [1] CRAN (R 4.1.1) reprex 2.0.1 2021-08-05 [1] CRAN (R 4.1.1) rlang 1.0.2 2022-03-04 [1] CRAN (R 4.1.1) rprojroot 2.0.3 2022-04-02 [1] CRAN (R 4.1.1) rstatix 0.7.0 2021-02-13 [1] CRAN (R 4.1.1) rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.1.1) rvest 1.0.2 2021-10-16 [1] CRAN (R 4.1.1) scales 1.2.0 2022-04-13 [1] CRAN (R 4.1.1) sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.1.1) stringi 1.7.6 2021-11-29 [1] CRAN (R 4.1.1) stringr 1.4.0 2019-02-10 [1] CRAN (R 4.1.1) survival 3.3-1 2022-03-03 [1] CRAN (R 4.1.1) survivalAnalysis 0.3.0 2022-02-11 [1] CRAN (R 4.1.1) survminer 0.4.9 2022-05-26 [1] Github (kassambara/survminer@54f0564) survMisc 0.5.6 2022-04-07 [1] CRAN (R 4.1.1) testthat 3.1.4 2022-04-26 [1] CRAN (R 4.1.1) tibble 3.1.6 2021-11-07 [1] CRAN (R 4.1.1) tidyr 1.2.0 2022-02-01 [1] CRAN (R 4.1.1) tidyselect 1.1.2 2022-02-21 [1] CRAN (R 4.1.1) tidytidbits 0.3.2 2022-03-16 [1] CRAN (R 4.1.1) tidyverse * 1.3.1 2021-04-15 [1] CRAN (R 4.1.1) tzdb 0.3.0 2022-03-28 [1] CRAN (R 4.1.1) usethis 2.1.5 2021-12-09 [1] CRAN (R 4.1.1) utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.1) vctrs 0.4.1 2022-04-13 [1] CRAN (R 4.1.1) withr 2.5.0 2022-03-03 [1] CRAN (R 4.1.1) xfun 0.30 2022-03-02 [1] CRAN (R 4.1.1) xml2 1.3.3 2021-11-30 [1] CRAN (R 4.1.1) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.1.1) zoo 1.8-10 2022-04-15 [1] CRAN (R 4.1.1)

[1] /home/user/R/x86_64-pc-linux-gnu-library/4.1 [2] /usr/local/lib/R/site-library [3] /usr/lib/R/site-library [4] /usr/lib/R/library

rschauner commented 2 years ago

Hi,

I'm not a maintainer of this package, but you may want to try using a fork of this repo for a PR I made (#582) that I think would solve your issue.

You should be able to install it using

if (require("remotes")) install.packages("remotes")
remotes::install_github("rschauner/survminer")

Hopefully this helps