{"action":"created","issue":{"url":"https://api.github.com/repos/kassambara/survminer/issues/304","repository_url":"https://api.github.com/repos/kassambara/survminer","labels_url":"https://api.github.com/repos/kassambara/survminer/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/kassambara/survminer/issues/304/comments","events_url":"https://api.github.com/repos/kassambara/survminer/issues/304/events","html_url":"https://github.com/kassambara/survminer/issues/304","id":318930205,"number":304,"title":"Wrongly looking ggsurvplot with facet.by","user":{"login":"dmiftakhutdinov","id":38861618,"avatar_url":"https://avatars3.githubusercontent.com/u/38861618?v=4","gravatar_id":"","url":"https://api.github.com/users/dmiftakhutdinov","html_url":"https://github.com/dmiftakhutdinov","followers_url":"https://api.github.com/users/dmiftakhutdinov/followers","following_url":"https://api.github.com/users/dmiftakhutdinov/following{/other_user}","gists_url":"https://api.github.com/users/dmiftakhutdinov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmiftakhutdinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmiftakhutdinov/subscriptions","organizations_url":"https://api.github.com/users/dmiftakhutdinov/orgs","repos_url":"https://api.github.com/users/dmiftakhutdinov/repos","events_url":"https://api.github.com/users/dmiftakhutdinov/events{/privacy}","received_events_url":"https://api.github.com/users/dmiftakhutdinov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-30T15:23:28Z","updated_at":"2018-04-30T18:01:48Z","closed_at":null,"author_association":"NONE","body":"### Expected behavior \r\nTwo survival plots, one with step for X = 1, and one without step for X = 2\r\n\r\n### Actual behavior\r\nFirst two commands: \"Error in allf[[1]] : subscript out of bounds\" occurs in strata function\r\nThird command: the second plot looks wrongly: only censoring symbol @ (20, 1.0) displayed.\r\n\r\nIt should be noted that the following works perfect:\r\n````{R}\r\nggsurvplot(npsurv(Surv(Time, Dead) ~ X, x))\r\n````\r\n\r\n### Steps to reproduce the problem\r\n````{R}\r\nx <- data.frame(Time = c(10, 20, 20, 20), Dead = c(TRUE, FALSE, FALSE, FALSE), X = c(1, 1, 2, 2), Q = c(1, 1, 1, 1))\r\nggsurvplot(npsurv(Surv(Time, Dead) ~ 1, x), facet.by = \"X\")\r\nggsurvplot(npsurv(Surv(Time, Dead) ~ X, x), facet.by = \"X\")\r\nggsurvplot(npsurv(Surv(Time, Dead) ~ Q, x), facet.by = \"X\")\r\n````\r\n\r\n### `session_info()`\r\n````{R}\r\nSession info ------------------------------------------------------------------------------------------------------------\r\n setting  value                       \r\n version  R version 3.3.3 (2017-03-06)\r\n system   x86_64, mingw32             \r\n ui       RStudio (1.0.136)           \r\n language (EN)                        \r\n collate  English_United States.1252  \r\n tz       America/New_York            \r\n date     2018-04-30                  \r\n\r\nPackages ----------------------------------------------------------------------------------------------------------------\r\n package      * version  date       source        \r\n acepack        1.4.1    2016-10-29 CRAN (R 3.3.3)\r\n assertthat     0.2.0    2017-04-11 CRAN (R 3.3.3)\r\n backports      1.1.2    2017-12-13 CRAN (R 3.3.3)\r\n base         * 3.3.3    2017-03-06 local         \r\n base64enc      0.1-3    2015-07-28 CRAN (R 3.3.2)\r\n bindr          0.1.1    2018-03-13 CRAN (R 3.3.3)\r\n bindrcpp       0.2.2    2018-03-29 CRAN (R 3.3.3)\r\n broom          0.4.4    2018-03-29 CRAN (R 3.3.3)\r\n checkmate      1.8.5    2017-10-24 CRAN (R 3.3.3)\r\n cluster        2.0.5    2016-10-08 CRAN (R 3.3.3)\r\n cmprsk         2.2-7    2014-06-17 CRAN (R 3.3.3)\r\n codetools      0.2-15   2016-10-05 CRAN (R 3.3.2)\r\n colorspace     1.3-2    2016-12-14 CRAN (R 3.3.3)\r\n data.table     1.10.4-3 2017-10-27 CRAN (R 3.3.3)\r\n datasets     * 3.3.3    2017-03-06 local         \r\n devtools       1.13.5   2018-02-18 CRAN (R 3.3.3)\r\n digest         0.6.15   2018-01-28 CRAN (R 3.3.3)\r\n dplyr          0.7.4    2017-09-28 CRAN (R 3.3.3)\r\n foreign        0.8-70   2018-04-23 CRAN (R 3.3.3)\r\n Formula      * 1.2-1    2015-04-07 CRAN (R 3.3.2)\r\n ggplot2      * 2.2.1    2016-12-30 CRAN (R 3.3.3)\r\n ggpubr       * 0.1.6    2017-11-14 CRAN (R 3.3.3)\r\n glue           1.2.0    2017-10-29 CRAN (R 3.3.3)\r\n graphics     * 3.3.3    2017-03-06 local         \r\n grDevices    * 3.3.3    2017-03-06 local         \r\n grid           3.3.3    2017-03-06 local         \r\n gridExtra      2.3      2017-09-09 CRAN (R 3.3.3)\r\n gtable         0.2.0    2016-02-26 CRAN (R 3.3.3)\r\n Hmisc        * 4.1-1    2018-01-03 CRAN (R 3.3.3)\r\n htmlTable      1.11.2   2018-01-20 CRAN (R 3.3.3)\r\n htmltools      0.3.6    2017-04-28 CRAN (R 3.3.3)\r\n htmlwidgets    1.2      2018-04-19 CRAN (R 3.3.3)\r\n km.ci          0.5-2    2009-08-30 CRAN (R 3.3.3)\r\n KMsurv         0.1-5    2012-12-03 CRAN (R 3.3.2)\r\n knitr          1.20     2018-02-20 CRAN (R 3.3.3)\r\n labeling       0.3      2014-08-23 CRAN (R 3.3.2)\r\n lattice      * 0.20-34  2016-09-06 CRAN (R 3.3.3)\r\n latticeExtra   0.6-28   2016-02-09 CRAN (R 3.3.3)\r\n lazyeval       0.2.1    2017-10-29 CRAN (R 3.3.3)\r\n magrittr     * 1.5      2014-11-22 CRAN (R 3.3.3)\r\n MASS           7.3-45   2016-04-21 CRAN (R 3.3.3)\r\n Matrix         1.2-8    2017-01-20 CRAN (R 3.3.3)\r\n MatrixModels   0.4-1    2015-08-22 CRAN (R 3.3.3)\r\n memoise        1.1.0    2017-04-21 CRAN (R 3.3.3)\r\n methods      * 3.3.3    2017-03-06 local         \r\n mnormt         1.5-5    2016-10-15 CRAN (R 3.3.2)\r\n multcomp       1.4-8    2017-11-08 CRAN (R 3.3.3)\r\n munsell        0.4.3    2016-02-13 CRAN (R 3.3.3)\r\n mvtnorm        1.0-7    2018-01-25 CRAN (R 3.3.3)\r\n nlme           3.1-131  2017-02-06 CRAN (R 3.3.3)\r\n nnet           7.3-12   2016-02-02 CRAN (R 3.3.3)\r\n parallel       3.3.3    2017-03-06 local         \r\n pillar         1.2.2    2018-04-26 CRAN (R 3.3.3)\r\n pkgconfig      2.0.1    2017-03-21 CRAN (R 3.3.3)\r\n plyr           1.8.4    2016-06-08 CRAN (R 3.3.3)\r\n polspline      1.1.12   2015-07-14 CRAN (R 3.3.2)\r\n profvis        0.3.5    2018-02-22 CRAN (R 3.3.3)\r\n psych          1.8.3.3  2018-03-30 CRAN (R 3.3.3)\r\n purrr          0.2.4    2017-10-18 CRAN (R 3.3.3)\r\n quantreg       5.35     2018-02-02 CRAN (R 3.3.3)\r\n R6             2.2.2    2017-06-17 CRAN (R 3.3.3)\r\n RColorBrewer   1.1-2    2014-12-07 CRAN (R 3.3.2)\r\n Rcpp           0.12.16  2018-03-13 CRAN (R 3.3.3)\r\n reshape2       1.4.3    2017-12-11 CRAN (R 3.3.3)\r\n rlang          0.2.0    2018-02-20 CRAN (R 3.3.3)\r\n rms          * 5.1-2    2018-01-07 CRAN (R 3.3.3)\r\n rpart          4.1-10   2015-06-29 CRAN (R 3.3.3)\r\n rstudioapi     0.7      2017-09-07 CRAN (R 3.3.3)\r\n sandwich       2.4-0    2017-07-26 CRAN (R 3.3.3)\r\n scales         0.5.0    2017-08-24 CRAN (R 3.3.3)\r\n SparseM      * 1.76     2017-03-09 CRAN (R 3.3.3)\r\n splines        3.3.3    2017-03-06 local         \r\n stats        * 3.3.3    2017-03-06 local         \r\n stringi        1.1.7    2018-03-12 CRAN (R 3.3.3)\r\n stringr        1.2.0    2017-02-18 CRAN (R 3.3.3)\r\n survival     * 2.40-1   2016-10-30 CRAN (R 3.3.3)\r\n survminer    * 0.4.2    2018-01-31 CRAN (R 3.3.3)\r\n survMisc       0.5.4    2016-11-23 CRAN (R 3.3.3)\r\n TH.data        1.0-8    2017-01-23 CRAN (R 3.3.3)\r\n tibble         1.4.2    2018-01-22 CRAN (R 3.3.3)\r\n tidyr          0.8.0    2018-01-29 CRAN (R 3.3.3)\r\n tools          3.3.3    2017-03-06 local         \r\n utils        * 3.3.3    2017-03-06 local         \r\n withr          2.1.2    2018-03-15 CRAN (R 3.3.3)\r\n xtable         1.8-2    2016-02-05 CRAN (R 3.3.3)\r\n zoo            1.8-1    2018-01-08 CRAN (R 3.3.3)\r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/kassambara/survminer/issues/comments/385479466","html_url":"https://github.com/kassambara/survminer/issues/304#issuecomment-385479466","issue_url":"https://api.github.com/repos/kassambara/survminer/issues/304","id":385479466,"user":{"login":"dmiftakhutdinov","id":38861618,"avatar_url":"https://avatars3.githubusercontent.com/u/38861618?v=4","gravatar_id":"","url":"https://api.github.com/users/dmiftakhutdinov","html_url":"https://github.com/dmiftakhutdinov","followers_url":"https://api.github.com/users/dmiftakhutdinov/followers","following_url":"https://api.github.com/users/dmiftakhutdinov/following{/other_user}","gists_url":"https://api.github.com/users/dmiftakhutdinov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmiftakhutdinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmiftakhutdinov/subscriptions","organizations_url":"https://api.github.com/users/dmiftakhutdinov/orgs","repos_url":"https://api.github.com/users/dmiftakhutdinov/repos","events_url":"https://api.github.com/users/dmiftakhutdinov/events{/privacy}","received_events_url":"https://api.github.com/users/dmiftakhutdinov/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T18:01:48Z","updated_at":"2018-04-30T18:01:48Z","author_association":"NONE","body":"Things seems to be connected to .connect2origin: it doesn't fill variables columns when fit parameter is not supplied. The only thing here, I was studying ggsurvplot without facet.by as I needed this for particular task and wanted to use ggsurvplot()$plot + facet_wrap() instead. ggsurvplot()$plot$data contains wrong values for time = 0 because .connect2origin doesn't fill values when fit parameter is not supplied."}}
{"actor":{"display_login":"dmiftakhutdinov"}}