You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice that data[, grouping.vars] gives inconsistent results for dataframe and tibble:
The former is a vector;
The latter is tibble.
Here's a reproducible example:
survminer:::.levels() can only operate on vectors, which is the cause of the error.
survminer:::.levels(test[,"rx"])
#> Error in xtfrm.data.frame(x) : cannot xtfrm data frames
So I suggest changing grp.levels <- .levels(data[, grouping.vars]) to grp.levels <- .levels(data[[grouping.vars]]) when length(grouping.vars) == 1 in surv_group_by .
When data is in tibble format,
ggsurvplot_facet
's pval = TRUE gives the following error:Error in xtfrm.data.frame(x) : cannot xtfrm data frames
Here's a reproducible example
I looked at the source code and found that
ggsurvplot_facet
callssurv_group_by
when pval = TRUE, and insurv_group_by
there is the following:Notice that
data[, grouping.vars]
gives inconsistent results for dataframe and tibble:The former is a vector;
The latter is tibble.
Here's a reproducible example:
survminer:::.levels()
can only operate on vectors, which is the cause of the error.So I suggest changing
grp.levels <- .levels(data[, grouping.vars])
togrp.levels <- .levels(data[[grouping.vars]])
whenlength(grouping.vars) == 1
insurv_group_by
.session_info()
The text was updated successfully, but these errors were encountered: