Skip to content

Enhancement proposition for filter #812

@Sade154

Description

@Sade154

Hello,

What do you think of having an additional argument for the filter function to keep NA values :

df <- data.frame(x = 1:10, y = c(1:7, NA, NA, NA), z = 1:10)

filter(df, y > 4) # 3 rows
df[df$y > 4, ]    # 6 rows
# option for filter : filter(, keepNA = TRUE) ?. The argument would be FALSE by default

I think it could be useful. In this case for example, y=NA doesn't mean y<= 4.

KR

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