Skip to content

extra NAs with droplevels = FALSE #130

@d-morrison

Description

@d-morrison

When I use droplevels = FALSE with table1.formula(), I'm getting extra NAs on the variable name lines. For example:

 iris |> 
   dplyr::filter(Species != "setosa") |>
   table1::table1(data = _, x =  ~ . | Species, droplevels = FALSE)

produces:

image

Probably an unusual case, but a colleague asked me for a table with an all-NA column like this. Is there a way to remove the extra NAs (on lines 1, 4, ,7, and 10)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions