```{=html}

```r
knitr::opts_chunk$set(warning = FALSE, message = FALSE, comment = NA)
knitr::opts_chunk$set(cache = FALSE)
options(width=170)
library(dataxray)
library(tidyverse)
library(haven)
library(crosstalk)
data <- params$data
dim  <- dim(data)
data_xray <- make_xray(data, by = params$by)

DATA XRAY {#main}

Inputs {.sidebar data-width=300}


d_reactable <- data_xray   

d_reactable_shared <- SharedData$new(d_reactable)

filter_select('type', 'variable TYPE',    d_reactable_shared, ~ TYPE)
filter_select('var',  'variable NAME',    d_reactable_shared, ~ VAR)
filter_select('lab',  'variable LABEL',   d_reactable_shared, ~ LABEL)
filter_select('n',    'variable COMPLETE',d_reactable_shared, ~ ifelse(n == dim[1], 'YES', 'NO'))

filter_slider('missing', 'variable % MISSING', d_reactable_shared,  ~ 100*(missing/dim[1]),
              width = 250,
              post = '%',
              min = 0, max = 100,
              dragRange = FALSE,
              step = 5, round = TRUE, sep = '', ticks = TRUE)

filter_slider('distinct', 'variable # DISTINCT', d_reactable_shared, ~ distinct,
              width = 250,
              min = 1, dragRange = FALSE,
              step = 5, ticks = FALSE)

Column

r toupper(params$data_name) DATA with r dim[1] OBSERVATIONS and r dim[2] VARIABLES

view_xray(data_xray = d_reactable, data_xray_shared = d_reactable_shared, by = params$by)


agstn/dataxray documentation built on Oct. 16, 2023, 11:16 p.m.