Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress as.tibble warning by converting to as_tibble #546

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions R/ggsurvplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -371,17 +371,14 @@ ggsurvplot <- function(fit, data = NULL, fun = NULL,



if(.is_list(fit)){
if(combine)
ggsurv <- do.call(ggsurvplot_combine, opts)
else ggsurv <- do.call(ggsurvplot_list, opts)
if (.is_list(fit)) {
if (combine) return(do.call(ggsurvplot_combine, opts))
do.call(ggsurvplot_list, opts)
}

else if(is.data.frame(fit))
ggsurv <- do.call(ggsurvplot_df, opts_df)

else if(.is_survfit(fit)){
if (is.data.frame(fit)) do.call(ggsurvplot_df, opts_df)

if (.is_survfit(fit)) {
if(!is.null(group.by)){
opts$group.by <- group.by
ggsurv <- do.call(ggsurvplot_group_by, opts)
Expand All @@ -406,11 +403,7 @@ ggsurvplot <- function(fit, data = NULL, fun = NULL,

}

else if(inherits(fit, "flexsurvreg"))
ggsurv <- do.call(ggflexsurvplot, opts)


return(ggsurv)
if (inherits(fit, "flexsurvreg")) do.call(ggflexsurvplot, opts)
}


Expand Down
4 changes: 2 additions & 2 deletions R/ggsurvplot_combine.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ ggsurvplot_combine <- function(fit, data,
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

if(keep.data){
res$data.survplot <- tibble::as.tibble(all.survsummary)
res$data.survtable <- tibble::as.tibble(all.survtable)
res$data.survplot <- tibble::as_tibble(all.survsummary)
res$data.survtable <- tibble::as_tibble(all.survtable)
}


Expand Down
2 changes: 1 addition & 1 deletion R/ggsurvplot_facet.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ ggsurvplot_facet <- function(fit, data, facet.by,
pvalue <- surv_pvalue(grouped.d$fit, grouped.d$data, pval.coord = pval.coord,
pval.method.coord = pval.method.coord,...) %>%
dplyr::bind_rows() %>%
tibble::as.tibble()
tibble::as_tibble()
# Select the grouping variable columns and cbind the corresponding pvalue
pvals.df <- grouped.d %>%
dplyr::select_( .dots = facet.by) %>%
Expand Down