R/deprecated/validate.R

Defines functions validate_plot_inputs validate_point validate_histogram

validate_plot_inputs <- function(input) {
  if (input$plot_type == CONST_POINT) validate_point(input)
  else if (input$plot_type == CONST_HISTOGRAM) validate_histogram(input)
  else stop("unexpected plot_type")
}

validate_point <- function(input) {
  validate(
    need(input$xvar, "  Select x variable."),
    need(input$yvar, "  Select y variable."),
    need(input$xvar != CONST_NONE, "  Select x variable."),
    need(input$yvar != CONST_NONE, "  Select y variable.")
  )
}

validate_histogram <- function(input) {
  validate(
    need(input$xvar, "  Select x variable."),
    need(input$xvar != CONST_NONE, "  Select x variable.")
  )
}
wcmbishop/gogoplot documentation built on May 29, 2019, 10:39 a.m.