Skip to content

Instantly share code, notes, and snippets.

sharla_diff <- function(df, expected_df) {
data_as_expected <- dplyr::all_equal(expected_df, df)
if (!isTRUE(data_as_expected)) {
data_diffs <- janitor::compare_df_cols(expected_df, df)
cols_mismatch <- dplyr::filter(data_diffs, is.na(expected_df) | is.na(df))
extra_cols <- cols_mismatch %>%
dplyr::filter(is.na(expected_df)) %>%
@MayaGans
MayaGans / app.R
Created January 24, 2020 15:06 — forked from gadenbuie/app.R
library(shiny)
# dummy list of dataframes
test <- data.frame("A" = NA, "B" = NA, "X" = NA)
test2 <- data.frame("D" = NA, "E" = NA, "F" = NA)
test3 <- data.frame("G" = NA, "H" = NA, "X" = NA)
combined_tests <- list(test = test, test2 = test2, test3 = test3)
# Turn list of dataframes into buckets of draggable blocks
rowBlock <- function(name) {
@MayaGans
MayaGans / app.R
Last active January 3, 2020 16:10 — forked from gadenbuie/app.R
drag and drop a new element
library(shiny)
library(tidyverse)
ui <- fluidPage(
tags$head(
tags$link(rel = "//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"),
tags$script(src = "https://code.jquery.com/ui/1.12.1/jquery-ui.js"),
tags$link(href = "styles.css", rel = "stylesheet")
),
fluidRow(