GenEst (version 1.2.4)

GenEstServer: The GenEst server definition function

Description

This suite of functions defines the server-side program for the GenEst user interface (UI). See the "GenEst Graphic User Interface" vignette for a more complete detailing of the codebase underlying the GenEst UI. GenEstServer: main server function expressed within the application.

reaction: creates a handler expression to be used by observeEvent within GenEstServer, which includes the call to eventReaction (the function that manages the reaction once the code is evaluated), any message generation or handling, and the enclosing curly braces. Calls reactionMessageRun and reactionMessageDone to create the event-specific reaction expression message components.

reactionMessageRun: Creates the message for model running, or clears the existing notifications if desired.

reactionMessageDone: Creates the message for model done running.

eventReaction: Manages the running of the update functions for rv, output, and input, based on the eventName.

Usage

GenEstServer(input, output, session)

reaction(eventName)

reactionMessageRun(eventName)

reactionMessageDone(eventName)

eventReaction(eventName, rv, input, output, session)

Arguments

input

input list for the GenEst GUI.

output

output list for the GenEst GUI.

session

Environment for the GenEst GUI.

eventName

Character name of the event. One of "clear_all", "file_SE", "file_SE_clear", "file_CP", "file_CP_clear", "file_SS", "file_SS_clear", "file_DWP", "file_DWP_clear", "file_CO", "file_CO_clear", "class", "obsSE", "predsSE", "run_SE", "run_SE_clear", "outSEclass", "outSEp", "outSEk", "ltp", "fta", "predsCP", "run_CP", "run_CP_clear", "outCPclass", "outCPdist", "outCPl", "outCPs", "run_M", "run_M_clear", "split_M", "split_M_clear", "transpose_split", "run_g", "run_g_clear", or "outgclass".

rv

Reactive values list for the GenEst GUI.

Value

reaction: An object of type "expression" returned from parse using the text argument. This is a parsed but unevaluated expression, ready to be evaluated by eval.

reactionMessageRun: Reaction running message expression, as a character string.

reactionMessageDone: Reaction done message expression, as a character string.

Details

GenEstServer is used as the main server function, and is therefore included in the server.R script of the app. This function is not used in a standard R function sense, in that it does not return a value and is not used on its own to have side effects. The code of the function has two parts:

  1. preamble that defines all the necessary variables and options

  2. observeEvent calls, one for each event in the application. Each call to observeEvent includes the eventExpr (event expression) as the first argument and the handlerExpr (handler expression) as the second argument, which is an evaluated (via eval) block of code returned from reaction for the specific event, as well as any other control switch arguments needed (such as ignoreNULL).