app_master: R6 master class (Controller) for your shiny application.

Description Public fields Methods

Description

app_master is the master class used across all modules of the the shiny app. It Stores all datasets needed in the applications as tibbles. All datasets meta information is also stored in this object

Public fields

params

initialization parameters

reactive_vals

reactiveValues instance that stores all reactive values needed in app

master_data

static values, non-reactive static datasets needed in the application. Note you can pre-load these

ds_config

configuration extracted from master config

dq_master

Stores Data Quality Information for each dataset

Methods

Public methods


Method new()

Standard R6 Initialize function

Usage
app_master$new(params)
Arguments
params

the config yml driven params for initialization

Returns

a new app_master object


Method get_dq_summary()

Gets SmartEDA::ExpData(type = 1) dataframe in lazy maner

Usage
app_master$get_dq_summary(ds_name, max_rows = Inf)
Arguments
ds_name

the ds_name

max_rows

if max_rows > nrow of ds than a random max_rows are selected else nrow is used. default is Inf for all rows

Returns

a new app_master object


Method get_dq_detail()

Gets SmartEDA::ExpData(type = 2) dataframe in lazy manner

Usage
app_master$get_dq_detail(ds_name, max_rows = Inf)
Arguments
ds_name

the ds_name

max_rows

if max_rows > nrow of ds than a random max_rows are selected else nrow is used. default is Inf for all rows

Returns

a new app_master object Add a row to app_master '


Method add_master_data_row()

Usage
app_master$add_master_data_row(row)
Arguments
row

new row object created with create_row removes the indexed row from app_master ' Note: the indexes are reindexed from 1 to nrow(master_data) after removal


Method remove_dataset()

Usage
app_master$remove_dataset(index)
Arguments
index

the rowindex replaces dataset with new row at the same index


Method replace_dataset_by_name()

Usage
app_master$replace_dataset_by_name(dataset_name, replace_with)
Arguments
dataset_name

the ds_name

replace_with

the row created with create_row load dataset config in a consumable fashion


Method load_ds_config()

Usage
app_master$load_ds_config(params)
Arguments
params

the params Preload app_master with csv files provided in config '

Note this creates new mdata overiding rvals


Method preload_master_with_config()

Usage
app_master$preload_master_with_config()
Returns

self object access dataset names as list


Method dataset_names()

Usage
app_master$dataset_names()
Returns

the names of datasets search for a tibble based on dataset_name


Method dataset_by_name()

Usage
app_master$dataset_by_name(dataset_name, max_rows = Inf)
Arguments
dataset_name

the name of the dataset to lookup

max_rows

(optional) if max_rows is set then sample max_rows from dataset.

Returns

the mapped dataset in tibble format search for a tibble based on index in mdata


Method data_by_index()

Usage
app_master$data_by_index(index)
Arguments
index

the row index of the dataset

Returns

the mapped dataset in tibble format get colnames for a dataset


Method colnames_for_dataset()

Usage
app_master$colnames_for_dataset(dataset_name)
Arguments
dataset_name

the name of the dataset to lookup

Returns

characted list of colnames Validate Datasets based on rules and prep conduct basic data prep Typically this method is called from _targets or at Design time when building the app Not ideal to call this method from shiny app. Note: validtion is done only if the dataset has the following set in config file ds_info_type and ds_info_url supported ds_info_type : google , excel and csv


Method ds_validate_and_prep()

Usage
app_master$ds_validate_and_prep()
Returns

logical FALSE if data validation Warnings or Errors elase TRUE get pretty colnames for a dataset


Method prettynames_for_dataset()

Usage
app_master$prettynames_for_dataset(dataset_name)
Arguments
dataset_name

the name of the dataset to lookup

Returns

characted list of colnames


Method clone()

The objects of this class are cloneable with this method.

Usage
app_master$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


shambhu112/shinyspring documentation built on July 9, 2021, 2:07 p.m.