BusinessLogic | R Documentation |
Responsible for the data wrangling, generation of text and charts and (it might be a bit of overkill in this app) filtering for the user interface. See [Using R6 as data storage](https://engineering-shiny.org/common-app-caveats.html#using-r6-as-data-storage) for more information on this solution.
months
Month numbers and their names, on the app selecting the month's name will return the month's number.
metrics
Available metrics with better looking names for the app.
data
Will store the data (more useful for bigger apps).
unique_carriers
Available carriers (more useful in the case of a database with more carriers being added over time).
results
Where results (title and text for the page and the chart itself) are stored.
new()
Create a new business logic object.
BusinessLogic$new()
A new 'BusinessLogic' object.
business_logic <- BusinessLogic$new() business_logic$generate_results("Endeavor Air", 1, "arr_delay", 30) business_logic$results$title business_logic$results$text business_logic$results$chart
generate_results()
Generate results, all parameters come directly from the user interface of the app.
BusinessLogic$generate_results( carrier_filter, month_filter, metric_filter, threshold )
carrier_filter
Carrier for report.
month_filter
Month for report.
metric_filter
Metric for report.
threshold
Threshold for report.
clone()
The objects of this class are cloneable with this method.
BusinessLogic$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `BusinessLogic$new` ## ------------------------------------------------ business_logic <- BusinessLogic$new() business_logic$generate_results("Endeavor Air", 1, "arr_delay", 30) business_logic$results$title business_logic$results$text business_logic$results$chart
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.