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

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

Open
Samve opened this issue Nov 15, 2024 · 0 comments
Open

Comments

@Samve
Copy link
Contributor

Samve commented Nov 15, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant