Skip to content

plot.hce gives an error if only one time-to-event outcome is provided. #93

Open
@Samve

Description

The following code
dat <- simHCE(n = 1000, TTE_A = 10, TTE_P = 15,
CM_A = 0.1, CM_P = 0, seed = 5)
plot(dat)

throws an error

Error in dplyr::filter():
ℹ In argument: outcome == step_outcomes[i - 1].
ℹ In group 1: arm = A.
Caused by error:
! ..1 must be of size 95 or 1, not size 0.
Run rlang::last_trace() to see where the error occurred.

Backtrace:

  1. ├─base::plot(dat)
  2. ├─maraca:::plot.hce(dat)
  3. │ └─maraca::plot_maraca(...)
  4. │ ├─base::do.call(...)
  5. │ └─base::lapply(...)
  6. │ └─maraca (local) FUN(X[[i]], ...)
  7. │ └─... %>% dplyr::ungroup()
  8. ├─dplyr::ungroup(.)
  9. ├─dplyr::mutate(., outcome = step_outcomes[i])
  10. ├─dplyr::ungroup(.)
  11. ├─dplyr::slice_tail(., n = 1)
  12. ├─dplyr::filter(., outcome == step_outcomes[i - 1])
  13. ├─dplyr:::filter.data.frame(., outcome == step_outcomes[i - 1])
  14. │ └─dplyr:::filter_rows(.data, dots, by)
  15. │ └─dplyr:::filter_eval(...)
  16. │ ├─base::withCallingHandlers(...)
  17. │ └─mask$eval_all_filter(dots, env_filter)
  18. │ └─dplyr (local) eval()
  19. └─dplyr:::dplyr_internal_error(...)
    Run rlang::last_trace(drop = FALSE) to see 5 hidden frames.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions