dreamRs / datamods

Shiny modules to import and manipulate data into an application or addin

Home Page:https://dreamrs.github.io/datamods/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add default value for missings

SteEcker opened this issue · comments

Hi, thanks for this useful package.

Would it be possible to include an optional argument to the filter function that sets the default value for the missing switch?
e.g. something like this:

filter_data_server <- function(id,
                               [...],
                               value_na = c(TRUE, FALSE),
                               label_na = "NA")

na_filter <- function(id, label = "NA", value = TRUE) {
  tags$span(
    style = "position: absolute; right: 0px; margin-right: -20px;",
    prettySwitch(
      inputId = id,
      label = label,
      value = value ,
      slim = TRUE,
      status = "primary",
      inline = TRUE
    )
  )
}

Good suggestion, if you re-install from GitHub filter_data_server() will have a value_na argument. Let me know how it works for you.

Victor

Hi @pvictor ,

Sorry for the late reply I didn't see the notification. Yes this works perfectly! Thank you.