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

error creating flextable #955

Closed
pavelaegorov opened this issue Nov 15, 2024 · 2 comments
Closed

error creating flextable #955

pavelaegorov opened this issue Nov 15, 2024 · 2 comments

Comments

@pavelaegorov
Copy link

Error when converting a rtable to a flextable:

Error in seq_len(nrow(raw_header)) :
argument must be coercible to non-negative integer
In addition: Warning message:
In seq_len(nrow(raw_header)) : first element used of 'length.out' argument

library(rtables)

ADSL <- ex_adsl # Example ADSL dataset
lyt <- basic_table() %>%
  split_cols_by("ARM") %>%
  analyze(vars = "AGE", afun = function(x) {
    in_rows(
      "Mean (sd)" = rcell(c(mean(x), sd(x)), format = "xx.xx (xx.xx)"),
      "Range" = rcell(range(x), format = "xx.xx - xx.xx")
    )
  })

tbl <- build_table(lyt, ADSL)
tt_to_flextable(tbl)
@shajoezhu
Copy link
Collaborator

dear @pavelaegorov , the example works fine with rtables 0.6.10, formatters 0.5.9 which are our latest cran releases. please check your package versions. thanks

image

@pavelaegorov
Copy link
Author

Thank you! Indeed, this issue happens on mcbook only. It works good on my windows machine.

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

2 participants