# Import variables passed in from shinyMer()
library(ggplot2)
library(shiny)

merMod <<- .shinyMerPar$merMod
if (is.null(.shinyMerPar$simData)) {

} else {
  newdata <<- .shinyMerPar$simData
}

if (!exists("newdata")) {
  df.choices <- c("Model Frame"   = "orig",
                  "Random Obs"    = "rand",
                  "Average Obs"   = "mean")
} else {
  df.choices <- c("User Supplied" = "user",
                  "Model Frame"   = "orig",
                  "Random Obs"    = "rand",
                  "Average Obs"   = "mean")
}

# Variables in the model frame that the user can restrict a random/average draw
# to (issue #32). Used to build the optional subset controls in the sidebar.
subset.choices <- c("(use all data)" = "", names(merMod@frame))
