Open Droopy2 opened 4 years ago
The following reproduces the problem:
Session info ----------------------------------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.5.1 (2018-07-02)
os Windows >= 8 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz America/Los_Angeles
date 2020-12-08
Packages --------------------------------------------------------------------------------------------------------------------------------------------------
package version date lib source
acepack 1.4.1 2016-10-29 [1] CRAN (R 3.5.1)
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.5.3)
backports 1.1.2 2017-12-13 [1] CRAN (R 3.5.0)
base64enc 0.1-3 2015-07-28 [1] CRAN (R 3.5.0)
boot 1.3-20 2017-08-06 [2] CRAN (R 3.5.1)
broom 0.5.0 2018-07-17 [1] CRAN (R 3.5.1)
callr 3.1.1 2018-12-21 [1] CRAN (R 3.5.2)
checkmate 1.8.5 2017-10-24 [1] CRAN (R 3.5.1)
cli 1.1.0 2019-03-19 [1] CRAN (R 3.5.3)
cluster 2.0.7-1 2018-04-13 [2] CRAN (R 3.5.1)
cmprsk 2.2-7 2014-06-17 [1] CRAN (R 3.5.1)
codetools 0.2-15 2016-10-05 [2] CRAN (R 3.5.1)
colorspace 1.3-2 2016-12-14 [1] CRAN (R 3.5.1)
cowplot 0.9.3 2018-07-15 [1] CRAN (R 3.5.1)
CPE 1.5.1 2018-09-25 [1] CRAN (R 3.5.3)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.1)
data.table 1.11.8 2018-09-30 [1] CRAN (R 3.5.1)
Deriv 4.0 2019-12-10 [1] CRAN (R 3.5.3)
desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.1)
devtools 2.0.2 2019-04-08 [1] CRAN (R 3.5.3)
digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.1)
doBy 4.6-3 2019-10-23 [1] CRAN (R 3.5.3)
dplyr 0.8.1 2019-05-14 [1] CRAN (R 3.5.3)
forcats 0.3.0 2018-02-19 [1] CRAN (R 3.5.1)
foreign 0.8-70 2017-11-28 [2] CRAN (R 3.5.1)
Formula 1.2-3 2018-05-03 [1] CRAN (R 3.5.0)
frailtypack 3.1.0 2020-01-16 [1] CRAN (R 3.5.3)
fs 1.2.6 2018-08-23 [1] CRAN (R 3.5.2)
generics 0.0.2 2018-11-29 [1] CRAN (R 3.5.3)
ggplot2 3.1.0 2018-10-25 [1] CRAN (R 3.5.1)
ggpubr 0.2 2018-11-15 [1] CRAN (R 3.5.1)
glue 1.3.1 2019-03-12 [1] CRAN (R 3.5.3)
gridExtra 2.3 2017-09-09 [1] CRAN (R 3.5.1)
gtable 0.2.0 2016-02-26 [1] CRAN (R 3.5.1)
haven 2.0.0 2018-11-22 [1] CRAN (R 3.5.1)
Hmisc 4.1-1 2018-01-03 [1] CRAN (R 3.5.1)
hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.1)
htmlTable 1.12 2018-05-26 [1] CRAN (R 3.5.1)
htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.1)
htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.5.1)
km.ci 0.5-2 2009-08-30 [1] CRAN (R 3.5.1)
KMsurv 0.1-5 2012-12-03 [1] CRAN (R 3.5.0)
knitr 1.20 2018-02-20 [1] CRAN (R 3.5.1)
labeling 0.3 2014-08-23 [1] CRAN (R 3.5.0)
lattice 0.20-35 2017-03-25 [2] CRAN (R 3.5.1)
latticeExtra 0.6-28 2016-02-09 [1] CRAN (R 3.5.1)
lava 1.6.5 2019-02-12 [1] CRAN (R 3.5.3)
lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.5.1)
lubridate 1.7.8 2020-04-06 [1] CRAN (R 3.5.3)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.1)
MASS 7.3-51.1 2018-11-01 [1] CRAN (R 3.5.1)
Matrix 1.2-14 2018-04-13 [2] CRAN (R 3.5.1)
MatrixModels 0.4-1 2015-08-22 [1] CRAN (R 3.5.1)
memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.2)
multcomp 1.4-8 2017-11-08 [1] CRAN (R 3.5.1)
munsell 0.5.0 2018-06-12 [1] CRAN (R 3.5.1)
mvtnorm 1.0-8 2018-05-31 [1] CRAN (R 3.5.0)
nlme 3.1-137 2018-04-07 [2] CRAN (R 3.5.1)
nnet 7.3-12 2016-02-02 [2] CRAN (R 3.5.1)
numDeriv 2016.8-1 2016-08-27 [1] CRAN (R 3.5.2)
pillar 1.4.0 2019-05-11 [1] CRAN (R 3.5.3)
pkgbuild 1.0.2 2018-10-16 [1] CRAN (R 3.5.2)
pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.1)
pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.2)
plyr 1.8.4 2016-06-08 [1] CRAN (R 3.5.1)
polspline 1.1.13 2018-06-14 [1] CRAN (R 3.5.0)
prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.2)
processx 3.2.1 2018-12-05 [1] CRAN (R 3.5.2)
ps 1.3.0 2018-12-21 [1] CRAN (R 3.5.2)
purrr 0.2.5 2018-05-29 [1] CRAN (R 3.5.1)
quantreg 5.36 2018-05-29 [1] CRAN (R 3.5.1)
R6 2.4.0 2019-02-14 [1] CRAN (R 3.5.3)
RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 3.5.0)
Rcpp 1.0.1 2019-03-17 [1] CRAN (R 3.5.3)
remotes 2.0.2 2018-10-30 [1] CRAN (R 3.5.2)
reshape2 1.4.3 2017-12-11 [1] CRAN (R 3.5.1)
rlang 0.3.4 2019-04-07 [1] CRAN (R 3.5.3)
rms 5.1-2 2018-01-07 [1] CRAN (R 3.5.1)
rpart 4.1-13 2018-02-23 [1] CRAN (R 3.5.1)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.1)
rstudioapi 0.8 2018-10-02 [1] CRAN (R 3.5.1)
sandwich 2.5-0 2018-08-17 [1] CRAN (R 3.5.1)
scales 1.0.0 2018-08-09 [1] CRAN (R 3.5.1)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.2)
SparseM 1.77 2017-04-23 [1] CRAN (R 3.5.0)
statmod 1.4.30 2017-06-18 [1] CRAN (R 3.5.1)
stringi 1.2.4 2018-07-20 [1] CRAN (R 3.5.1)
stringr 1.3.1 2018-05-10 [1] CRAN (R 3.5.1)
survC1 1.0-2 2013-02-14 [1] CRAN (R 3.5.3)
survival 2.43-3 2018-11-26 [1] CRAN (R 3.5.1)
survminer 0.4.8 2020-07-25 [1] CRAN (R 3.5.1)
survMisc 0.5.5 2018-07-05 [1] CRAN (R 3.5.1)
table1 1.2.1 2020-11-26 [1] CRAN (R 3.5.1)
TH.data 1.0-9 2018-07-10 [1] CRAN (R 3.5.1)
tibble 2.1.1 2019-03-16 [1] CRAN (R 3.5.3)
tidyr 0.8.2 2018-10-28 [1] CRAN (R 3.5.1)
tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.1)
timereg 1.9.4 2019-07-30 [1] CRAN (R 3.5.3)
UpSetR 1.3.3 2017-03-21 [1] CRAN (R 3.5.1)
usethis 1.4.0 2018-08-14 [1] CRAN (R 3.5.2)
withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.1)
writexl 1.1 2018-12-02 [1] CRAN (R 3.5.2)
xtable 1.8-3 2018-08-29 [1] CRAN (R 3.5.1)
yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.1)
zoo * 1.8-4 2018-09-19 [1] CRAN (R 3.5.1)
library(survival) library(survminer)
set.seed(42) n <- 100 df <- data.frame(e.time = sample(c(1:100), n, T), nn <- rpois(n, 1) )
df <- as.data.frame(lapply(df, rep, df$nn)) df$event <- 1
surv.obj <- with(df, Surv(e.time, event)) surv.fit <- survfit(surv.obj ~ NULL , data = df)
ggsurvplot(surv.fit, fun = "event", conf.int = T, ylim = c(0,2), break.y.by = 0.1 )
ggsurvplot(surv.fit, fun = "cumhaz", conf.int = T, ylim = c(0,2) )
ggsurvplot(surv.fit, fun = "cumhaz", conf.int = T, break.y.by = 0.1 )
ggsurvplot(surv.fit, fun = "event", conf.int = T, break.y.by = .33 )
ggsurvplot(surv.fit, fun = "pct", conf.int = T, break.y.by = 0.25 )
Expected behavior
in ggsurvplot, using break.y.by should adjust the number of ticks on the y-axis
Actual behavior
break.y.by does not seem to work, removes most numbers from the y-axis
Steps to reproduce the problem
session_info()