Skip to content

[Feature Request]: values(keep_na = logical(1)) to handle NA  #5

@gogonzo

Description

@gogonzo

Feature description

Related to very old issue present in des also: insightsengineering/teal.transform#30

We already found a quite nice solution in teal_slice(keep_na). In teal.slice when column contains any NA, checkbox input is automatically added to the filter-state-card. We expect similar in pick_ui

Consider following example
data <- within(teal.data::teal_data(), {
  iris <- iris
  mtcars <- mtcars
  iris$Species[1:5] <- NA 
})

app <- init(
  data = data,
  modules = modules(
    modules(
      label = "Testing modules",
      tm_merge(
        label = "non adam",
        picks = list(
          a = picks(
            datasets("iris", "iris"),
            variables(
              choices = c("Sepal.Length", "Species"),
              selected = "Species"
            ),
            values()
          )
        )
      )
    )
  )
)

shinyApp(app$ui, app$server, enableBookmarking = "server")
  1. how NA should be included in choices/selected?
values(choices, selected, keep_na = TRUE/FALSE)
# adds keep_na to the attributes of the `pick` object
  1. how NA should be displayed handled in the pick_ui/srv?
  • checkbox-input should be added below pickerInput (or rangeSlider or other input related with class of the column)
  • changing input should update attribute in the object
  1. how NA should be handled in merge_srv

Reactive keep_na should be delivered somehow to merge_srv > .qenv_merge > .merge_expr > .call_dplyr_filter and handled respectively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions