diff --git a/404.html b/404.html index 1a9c252..8a39c7e 100644 --- a/404.html +++ b/404.html @@ -30,7 +30,7 @@ FreesearchR - 25.8.2 + 25.8.3 + + + + + +
+
+
+ +
+

Dimensions validation

+
+ +
+

Usage

+
dim_change_call(before, after, fun)
+
+ +
+

Arguments

+ + +
before
+

data before

+ + +
after
+

data after

+ + +
fun
+

dimension function. ncol or nrow

+ +
+
+

Value

+

data.frame

+
+ +
+ + +
+ + + + + + + diff --git a/reference/drop_empty_event.html b/reference/drop_empty_event.html index fadccdd..aa7c19a 100644 --- a/reference/drop_empty_event.html +++ b/reference/drop_empty_event.html @@ -7,7 +7,7 @@ FreesearchR - 25.8.2 + 25.8.3 + + + + + +
+
+
+ +
+

Create validation data.frame

+
+ +
+

Usage

+
make_validation(ls, ...)
+
+ +
+

Arguments

+ + +
ls
+

validation list

+ + +
...
+

magic dots

+ +
+
+

Value

+

data.frame

+
+ +
+

Examples

+
i18n <- shiny.i18n::Translator$new(translation_csvs_path = here::here("inst/translations"))
+#> Warning: You didn't specify config translation yaml file. Default settings are used.
+i18n$set_translation_language("en")
+df_original <- mtcars
+df_original[1,2:4] <- NA
+df_obs <- df_original |> dplyr::filter(carb==4)
+df_vars <- df_original[1:7]
+val <- purrr::map2(
+  .x = validation_lib(),
+  .y = list(
+  list(x = df_original, y = df_obs),
+  list(x = df_original, y = df_vars),
+  list(x=df_original)),
+  make_validation
+)
+#> Error in validation_lib(): could not find function "validation_lib"
+val |> make_validation_alerts()
+#> Error: object 'val' not found
+
+val2 <- purrr::map2(
+  .x = validation_lib()[2],
+  .y = list(list(x = mtcars, y = mtcars[0])),
+  make_validation
+)
+#> Error in validation_lib(): could not find function "validation_lib"
+val2 |> make_validation_alerts()
+#> Error: object 'val2' not found
+
+val3 <- make_validation(
+  ls = validation_lib()[[2]],
+  list(x = mtcars, y = mtcars[0])
+)
+#> Error in validation_lib(): could not find function "validation_lib"
+
+
+
+ + +
+ + + + + + + diff --git a/reference/make_validation_alerts.html b/reference/make_validation_alerts.html new file mode 100644 index 0000000..f429594 --- /dev/null +++ b/reference/make_validation_alerts.html @@ -0,0 +1,82 @@ + +Create alert from validation data.frame — make_validation_alerts • FreesearchR + Skip to contents + + +
+
+
+ +
+

Create alert from validation data.frame

+
+ +
+

Usage

+
make_validation_alerts(data)
+
+ +
+

Arguments

+ + +
data
+
+ +
+ +
+ + +
+ + + + + + + diff --git a/reference/merge_expression.html b/reference/merge_expression.html index 542d752..73f2aff 100644 --- a/reference/merge_expression.html +++ b/reference/merge_expression.html @@ -7,7 +7,7 @@ FreesearchR - 25.8.2 + 25.8.3 + + + + + +
+
+
+ +
+

Validate function of missingness in data

+
+ +
+

Usage

+
missings_validate(data)
+
+ +
+

Arguments

+ + +
data
+

data set

+ +
+
+

Value

+

data.frame

+
+ +
+

Examples

+
df <- mtcars
+df[1,2:4] <- NA
+missings_validate(df)
+#>   p_miss
+#> 1   0.85
+
+
+
+ + +
+ + + + + + + diff --git a/reference/modify_qmd.html b/reference/modify_qmd.html index 3ac395d..dd70005 100644 --- a/reference/modify_qmd.html +++ b/reference/modify_qmd.html @@ -7,7 +7,7 @@ FreesearchR - 25.8.2 + 25.8.3 + + + + + +
+
+
+ +
+

Observations filter test wrapper

+
+ +
+

Usage

+
obs_filter_validate(before, after)
+
+ +
+

Arguments

+ + +
before
+

data before

+ + +
after
+

data after

+ +
+
+

Value

+

vector

+
+ +
+ + +
+ + + + + + + diff --git a/reference/overview_vars.html b/reference/overview_vars.html index 9ce9e69..52bf7c5 100644 --- a/reference/overview_vars.html +++ b/reference/overview_vars.html @@ -7,7 +7,7 @@ FreesearchR - 25.8.2 + 25.8.3 + + + + + +
+
+
+ +
+

Check that a dataset respect some validation expectations.

+
+ +
+

Usage

+
validation_ui(id, max_height = NULL, ...)
+
+validation_server(id, data)
+
+ +
+

Arguments

+ + +
id
+

Module's ID.

+ + +
max_height
+

Maximum height for validation results element, useful if you have many rules.

+ + +
...
+

Arguments passed to actionButton or uiOutput depending on display mode, +you cannot use inputId/outputId, label or icon (button only).

+ + +
data
+

a reactive function returning a data.frame.

+ +
+
+

Value

+ +
  • UI: HTML tags that can be included in shiny's UI

  • +
  • Server: a list with two slots:

    • status: a reactive function returning the best status available between "OK", "Failed" or "Error".

    • +
    • details: a reactive function returning a list with validation details.

    • +
  • +
+ +
+

Examples

+
#' Data and analyses validation demo
+#'
+#' @returns
+#' @export
+#'
+#' @examples
+#' \dontrun{
+#' validation_demo_app()
+#' }
+validation_demo_app <- function() {
+  ui <- shiny::fluidPage(
+    shiny::tags$h2("Validation"),
+    IDEAFilter::IDEAFilter_ui("data_filter"),
+    shiny::br(),
+    DT::DTOutput("data_final"),
+    shiny::br(),
+    validation_ui("validation_demo_2")
+  )
+
+  server <- function(input, output, session) {
+    rv <- shiny::reactiveValues(
+      data_original = shiny::reactive(mtcars),
+      data_filtered = NULL
+    )
+
+    rv_validation <- shiny::reactiveValues(
+      obs_filter = NULL,
+      vars_filter = NULL
+    )
+
+    data_filter <- IDEAFilter::IDEAFilter(
+      id = "data_filter",
+      data = mtcars,
+      verbose = TRUE
+    )
+
+    shiny::observeEvent(
+      data_filter(),
+      {
+        rv$data_filtered <- data_filter()
+      }
+    )
+
+    output$data_final <- DT::renderDT(
+      data_filter()
+    )
+
+    shiny::observeEvent(
+      list(
+        data_filter()
+      ),
+      {
+        to_make_validation <- data_filter()
+        ## Validation
+        if (!is.null(to_make_validation)) {
+          validation <-
+            make_validation(
+              ls = validation_lib("obs_filter"),
+              list(
+                x = mtcars,
+                y = to_make_validation
+              )
+            )
+
+        rv_validation$vars_filter <- validation
+
+        validation_server(id = "validation_demo_2", data = rv_validation$vars_filter)
+
+        }
+
+
+      }
+    )
+
+    # shiny::observeEvent(
+    #   list(
+    #     shiny::reactive(rv_validation$vars_filter)(),
+    #     data_filter()
+    #   ),
+    #   {
+    #     # browser()
+    #     # to_make_alert <- shiny::isolate(rv_validation$vars_filter)
+    #     to_make_alert <- shiny::reactive(rv_validation$vars_filter)()
+    #     if (!is.null(rv_validation$vars_filter)) {
+    #       validation_server(id = "validation_demo_2", data = to_make_alert)
+    #     }
+    #   }
+    # )
+  }
+  shiny::shinyApp(ui, server)
+}
+
+
+#' Title
+#'
+#' @returns
+#' @export
+#'
+#' @examples
+#' validation_nr_demo_app()
+validation_nr_demo_app <- function() {
+  ui <- shiny::fluidPage(
+    shiny::tags$h2("Validation"),
+    shiny::br(),
+    validation_ui("validation_demo_1", max_height = "30px"),
+    shiny::br(),
+    validation_ui("validation_demo_2")
+  )
+
+  server <- function(input, output, session) {
+    df_original <- mtcars
+
+    df_obs <- mtcars |> dplyr::filter(mpg > 20)
+
+    df_vars <- df_obs[1:6]
+
+    val1 <- purrr::map2(
+      .x = validation_lib()[1],
+      .y = list(list(x = df_original, y = df_obs)),
+      make_validation
+    )
+
+    val2 <- make_validation(
+      ls = validation_lib()[[2]],
+      list(x = df_original, y = df_vars)
+    )
+
+    validation_server(id = "validation_demo_1", data = val1)
+
+    validation_server(id = "validation_demo_2", data = val2)
+  }
+  shiny::shinyApp(ui, server)
+}
+
+
+
+ + +
+ + + + + + + diff --git a/reference/validation_lib.html b/reference/validation_lib.html new file mode 100644 index 0000000..1dfb985 --- /dev/null +++ b/reference/validation_lib.html @@ -0,0 +1,94 @@ + +Validation library — validation_lib • FreesearchR + Skip to contents + + +
+
+
+ +
+

Validation library

+
+ +
+

Usage

+
validation_lib(name = NULL)
+
+ +
+

Arguments

+ + +
name
+

Index name

+ +
+
+

Value

+

list

+
+ +
+

Examples

+
validation_lib()
+#> Error in validation_lib(): could not find function "validation_lib"
+validation_lib("missings")
+#> Error in validation_lib("missings"): could not find function "validation_lib"
+
+
+
+ + +
+ + + + + + + diff --git a/reference/validation_server.html b/reference/validation_server.html new file mode 100644 index 0000000..d053e98 --- /dev/null +++ b/reference/validation_server.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/reference/vars_filter_validate.html b/reference/vars_filter_validate.html new file mode 100644 index 0000000..0a29d02 --- /dev/null +++ b/reference/vars_filter_validate.html @@ -0,0 +1,98 @@ + +Variable filter test wrapper — vars_filter_validate • FreesearchR + Skip to contents + + +
+
+
+ +
+

Variable filter test wrapper

+
+ +
+

Usage

+
vars_filter_validate(before, after)
+
+ +
+

Arguments

+ + +
before
+

data before

+ + +
after
+

data after

+ +
+
+

Value

+

vector

+
+ +
+

Examples

+
vars_filter_validate(mtcars, mtcars[1:6])
+#> Error in vars_filter_validate(mtcars, mtcars[1:6]): could not find function "vars_filter_validate"
+vars_filter_validate(mtcars, mtcars[0])
+#> Error in vars_filter_validate(mtcars, mtcars[0]): could not find function "vars_filter_validate"
+
+
+
+ + +
+ + + + + + + diff --git a/reference/vectorSelectInput.html b/reference/vectorSelectInput.html index 3f0f3c3..ec10d20 100644 --- a/reference/vectorSelectInput.html +++ b/reference/vectorSelectInput.html @@ -7,7 +7,7 @@ FreesearchR - 25.8.2 + 25.8.3