Skip to content

Remove missing values in a fc_filter() #46

@pasahe

Description

@pasahe

Add a new argument called na.rm in the fc_filter() function. With this new argument, users could specify whether or not to remove missing values when a filter contains missing values. The default will be TRUE to mimic the current behaviour.

For instance, in the following example fc_filter() removes missing values automatically:

data.frame(XX = c(1,2,NA, 3:9, NA)) |>
 as_fc() |> 
fc_filter(XX >= 5) |> 
fc_draw()
Image

To keep them, the current workaround is to:

data.frame(XX = c(1,2,NA, 3:9, NA)) |>
 as_fc() |> 
fc_filter(XX >= 5 | is.na(XX)) |> 
fc_draw()
Image

The future na.rm argument would allow to keep missings by just specifying fc_filter(XX >= 5, na.rm = FALSE).

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