Skip to content

boxcox_trans() does not work with missing values. #181

@sflippl

Description

@sflippl

In the presence of missing values, boxcox_trans does not work:

trans <- scales::boxcox_trans(p = 0)
# This works:
trans$trans(1:3)
# This does not work:
trans$trans(c(1:3, NA_real_))

The issue is with the if clause. Because any(c(1:3, NA_real_) > 0) returns NA, the condition cannot be evaluated. Adding na.rm = TRUE should fix it. I'm happy to modify the R and the test file if that is helpful.

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