mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-12-15 17:12:09 +01:00
examples removed to enable rendering
Some checks failed
pkgdown.yaml / pkgdown (push) Has been cancelled
Some checks failed
pkgdown.yaml / pkgdown (push) Has been cancelled
This commit is contained in:
parent
c2fa49e914
commit
54dd332cd8
2 changed files with 0 additions and 65 deletions
|
|
@ -6,7 +6,6 @@
|
|||
#' @returns Shiny ui module
|
||||
#' @export
|
||||
#'
|
||||
#' @example examples/visual_summary_demo.R
|
||||
visual_summary_ui <- function(id) {
|
||||
ns <- shiny::NS(id)
|
||||
|
||||
|
|
@ -100,14 +99,6 @@ modal_visual_summary <- function(id,
|
|||
#' @returns An [apexchart()] `htmlwidget` object.
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' # 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)
|
||||
missings_apex_plot <- function(data, animation = FALSE, ...) {
|
||||
l <- data_summary_gather(data, ...)
|
||||
|
||||
|
|
@ -158,14 +149,6 @@ missings_apex_plot <- function(data, animation = FALSE, ...) {
|
|||
#' @returns ggplot2 object
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' # 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")
|
||||
visual_summary <- function(data, legend.title = NULL, ylab = "Observations", ...) {
|
||||
l <- data_summary_gather(data, ...)
|
||||
|
||||
|
|
|
|||
|
|
@ -69,51 +69,3 @@ 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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue