% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visual_summary.R
\name{visual-summary}
\alias{visual-summary}
\alias{visual_summary_ui}
\alias{visual_summary_server}
\alias{modal_visual_summary}
\alias{missings_apex_plot}
\alias{visual_summary}
\title{Data correlations evaluation module}
\usage{
visual_summary_ui(id)

visual_summary_server(id, data_r = shiny::reactive(NULL), ...)

modal_visual_summary(
  id,
  title = "Visual overview of data classes and missing observations",
  easyClose = TRUE,
  size = "xl",
  footer = NULL,
  ...
)

missings_apex_plot(data, animation = FALSE, ...)

visual_summary(data, legend.title = NULL, ylab = "Observations", ...)
}
\arguments{
\item{id}{id}

\item{data_r}{reactive data}

\item{...}{optional arguments passed to data_summary_gather()}

\item{title}{title}

\item{easyClose}{easyClose}

\item{size}{modal size}

\item{footer}{modal footer}

\item{data}{data}

\item{legend.title}{Legend title}

\item{ylab}{Y axis label}
}
\value{
Shiny ui module

shiny server

shiny modal

An \code{\link[=apexchart]{apexchart()}} \code{htmlwidget} object.

ggplot2 object
}
\description{
Data correlations evaluation module

Visual summary server

Visual summary modal

Plot missings and class with apexcharter. Not in use with FreesearchR.

Ggplot2 data summary visualisation based on visdat::vis_dat.
}
\examples{
visual_summary_demo_app <- function() {
  ui <- shiny::fluidPage(
    shiny::actionButton(
      inputId = "modal_missings",
      label = "Visual summary",
      width = "100\%",
      disabled = FALSE
    )
  )
  server <- function(input, output, session) {
    data_demo <- mtcars
    data_demo[sample(1:32, 10), "cyl"] <- NA
    data_demo[sample(1:32, 8), "vs"] <- NA
    data_demo$gear <- factor(data_demo$gear)

    visual_summary_server(id = "data", data = shiny::reactive(data_demo),summary.fun=class)

    observeEvent(input$modal_missings, {
      tryCatch(
        {
          modal_visual_summary(id = "data")
        },
        error = function(err) {
          showNotification(paste0("We encountered the following error browsing your data: ", err), type = "err")
        }
      )
    })
  }
  shiny::shinyApp(ui, server)
}

visual_summary_demo_app()
data_demo <- mtcars
data_demo[2:4, "cyl"] <- NA
rbind(data_demo, data_demo, data_demo, data_demo) |> missings_apex_plot()
data_demo |> missings_apex_plot()
mtcars |> missings_apex_plot(animation = TRUE)
# dplyr::storms |> missings_apex_plot()
visdat::vis_dat(dplyr::storms)
data_demo <- mtcars
data_demo[sample(1:32, 10), "cyl"] <- NA
data_demo[sample(1:32, 8), "vs"] <- NA
visual_summary(data_demo)
visual_summary(data_demo, palette.fun = scales::hue_pal())
visual_summary(dplyr::storms, summary.fun = data_type)
visual_summary(dplyr::storms, summary.fun = data_type, na.label = "Missings", legend.title = "Class")
}
