uace-azmet / azmet-forecast-qa

Developing QA/QC routines for AZMet
0 stars 1 forks source link

Allow date filtering / selection in pointblank reports #23

Closed Aariq closed 1 year ago

Aariq commented 1 year ago

Might be implemented as a Shiny widget? Be able to choose date range and have pointblank validation re-run for only those dates.

Aariq commented 1 year ago

Simple example that works in Quarto:

---
title: "pointblank"
format: html
editor: visual
server: shiny
---

```{r}
library(shiny)
library(gt)

Shiny example

sliderInput("num", "Number for filtering table",
            min = 1, max = 10, value = 10)
gt_output(outputId = "table")
#| context: server

#packages have to be in context: server also
library(gt)
library(pointblank)

output$table <- 
  gt::render_gt({
    tbl <-
      dplyr::tibble(
        a = c(5, 7, 6, 5, 8, 7),
        b = c(7, 1, 0, 0, 0, 3)
      ) |> dplyr::filter(a < input$num)
    agent <-
      create_agent(
        tbl = tbl,
        label = "`interrogate()` example"
      ) %>%
      col_vals_gt(columns = vars(a), value = 5) %>%
      interrogate()
    get_agent_report(agent)
  })
Aariq commented 1 year ago

Implemented test in PR 29 (https://github.com/cct-datascience/azmet-qaqc/pull/29). Not sure that this is actually the way to go.