Skip to content

Optimize if_else/coalesce to fifelse/fcoalesce? #112

@MichaelChirico

Description

@MichaelChirico

data.table now has its own implementation of if_else (fifelse) and coalesce (fcoalesce).

I just tried the following: add two lines to dplyr/tests/testthat.R:

library(testthat)
library(dplyr)
if_else = data.table::fifelse
coalesce = data.table::fcoalesce

test_check("dplyr")

then run testthat::test_dir('tests').

7 tests failed, but the same tests failed if I removed those two lines, so I'm taking that to mean fifelse and fcoalesce pass usage tests dplyr for behavior users expect of those functions.

Does it make sense/would it be straightforward to optimize those functions when used in dtplyr?

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