Skip to content

Implement as_flextable() for transposed crosstables when compact=TRUE #91

@DanChaltiel

Description

@DanChaltiel
library(crosstable)
crosstable(mtcars2, c(mpg, drat, wt, qsec), by=am) %>% 
  t() %>% as_flextable(compact=FALSE)

image

crosstable(mtcars2, c(mpg, drat, wt, qsec), by=am) %>% 
  t() %>% as_flextable(compact=TRUE)
#> Error in `mutate()`:
#> ℹ In argument: `variable = ifelse(.data$gp, label, variable)`.
#> Caused by error:
#> ! object 'label' not found

Created on 2024-12-11 with reprex v2.1.1

Also, add a hint to the pivot_ct() error when by is not null: "Do you need t()?"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions