Skip to content

Translation from case_when to fcase() will throw error when T is used instead of TRUE. #272

@gitgud5000

Description

@gitgud5000

When calling T instead of TRUE inside this a case_when using dplyr causes the function to fail.

This works:

iris %>% 
lazy_dt() %>%
  mutate(new_col = case_when( Sepal.Length> 4.5 ~ "foo",
                              TRUE ~ "bar"))

This breaks:

iris %>% 
lazy_dt() %>%
  mutate(new_col = case_when( Sepal.Length> 4.5 ~ "foo",
                              T ~ "bar"))

Error message output to the console:

Error in fcase(Sepal.Length > 4.5, "foo", TRUE, "bar") : 
  Argument #3 has a different length than argument #1. Please make sure all logical conditions have the same length.

Metadata

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