Skip to contents

Loads the input structure data into R from an Excel file.

Usage

load_input_xlsx(path)

inp_str_test(
  inp_raw_str,
  fn_inp_str = gen_inp_str,
  fn_inp_ui = gen_tabinp_ui,
  ns = NS(NULL),
  ...
)

gen_inp_str_front(inp_table_str = NULL, ...)

gen_inp_str(inp_raw_str, n_choices, inp_table_str = NULL, ns = NS(NULL), ...)

test_gen_inp_front_simple(
  inp_raw_str,
  inp_tab_str = NULL,
  inp_table_str = NULL,
  n_choices = 2
)

test_gen_inp_front_tabs(
  inp_raw_str,
  inp_tab_str = NULL,
  inp_table_str = NULL,
  n_choices = 2
)

test_gen_inp_front_tabs_file(path)

load_inputtabs_xlsx(path)

load_inputtables_xlsx(path)

Arguments

path

path to a pre-defined Excel file#'

inp_raw_str

inputs structure as returned by `load_input_xlsx()`

fn_inp_str, fn_inp_ui, ns

internal supporting functions.

ns

name space function `NS(NULL)` by default

...

passed to functions within

inp_table_str

structure of tables under which inputs are organized (NULL by default)

n_choices

number of policy choices to generate

inp_raw_str, inp_tab_str, inp_table_str, n_choices

input layout options

Value

a data frame with the detailed input structure.

Functions

  • inp_str_test(): Test if RAW inputs structure generates a set of UI elements and returns a very long list with HTML tags and elements used for building the UI. If it fails, it indicates that the app will likely fail as well.

  • gen_inp_str_front(): Wrapper around `gen_inp_str()` used for providing table structure inside other functions. Returns `gen_inp_str()` function with predefined parameters and data that can be executed for generating input structure.

  • gen_inp_str(): Generate a data frame of the inputs UI used in creating the inputs page UI

  • test_gen_inp_front_simple(): Test input page content generation in a single tab

  • test_gen_inp_front_tabs(): Test input UI generation process by providing path to the inputs structure Excel file. It Launches a shiny app with all inputs properly rendered in a single input tab.

  • test_gen_inp_front_tabs_file(): Does the same as `test_gen_inp_front_tabs()`, but on top of input generation also creates tabs for switching between groups of inputs.

  • load_inputtabs_xlsx(): Loads RAW structure of the tabs that should be used for structuring inputs

  • load_inputtables_xlsx(): Loads RAW structure of the tables for organizing inputs on the input page.

Examples

if (FALSE) {
system.file(
  "examples",
  "ceq_example_simple",
  "data-app",
  "simple-inputs-structure.xlsx",
  package = "devCEQ"
) |> load_input_xlsx()
}


if (FALSE) {
}

if (FALSE) {
a <- system.file(
    "examples",
    "ceq_example_simple",
    "data-app",
    "simple-inputs-structure.xlsx",
    package = "devCEQ"
  ) |> load_input_xlsx()
a |> test_gen_inp_front_simple()
}

if (FALSE) {
}
if (FALSE) {
}