Description Usage Arguments Value Examples
View source: R/wheel_visualizer.R
This function will create a histogram plot for the resulting data frame from the wheel_extractor() function.
1 2 3 4 5 | wheel_visualizer(
data = NULL,
visualization_type = "ggplot_histogram",
include_in_the_money = FALSE
)
|
data |
A resulting data frame object from wheel_extractor() function. |
visualization_type |
Currently only support ggplot2's ggplot_histogram. |
include_in_the_money |
The Wheel generally employs on OTM options. But the data frame also includes ITM. |
Ggplot2 histogram chart.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #First let's create sample data frame
sample <- data.frame(
strikePrice = c(50, 60, 70, 80),
inTheMoney = c(FALSE, FALSE, FALSE, TRUE),
ticker = c('AAPL', 'AAPL', 'TSLA', 'TSLA'),
prob_otm = c(0.3, 0.4, 0.3, 0.4),
cash_inflow = c(250, 400, 115, 220),
invested_capital = c(5000, 6000, 7000, 8000),
return_on_risk = c(0.05, 0.07, 0.02, 0.03)
)
#Then use the function
wheel_visualizer(data = sample)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.