View source: R/plot-hai-density.R
hai_density_plot | R Documentation |
this will produce a ggplot2
or plotly
histogram plot of the
density information provided from the hai_get_density_data_tbl
function.
hai_density_plot(
.data,
.dist_name_col,
.x_col,
.y_col,
.size = 1,
.alpha = 0.382,
.interactive = FALSE
)
.data |
The data that is produced from using |
.dist_name_col |
The column that has the distribution name, should be distribution and that is set as the default. |
.x_col |
The x value from the tidied density object. |
.y_col |
The y value from the tidied density object. |
.size |
The size parameter for ggplot. |
.alpha |
The alpha parameter for ggplot. |
.interactive |
This is a Boolean fo TRUE/FALSE and is defaulted to FALSE.
TRUE will produce a |
This will produce a density plot of the density information that is
produced from the function hai_get_density_data_tbl
. It will look for an attribute
from the .data
param to ensure the function was used.
A plot, either ggplot
2 or plotly
Steven P. Sanderson II, MPH
Other Distribution Plots:
hai_density_hist_plot()
,
hai_density_qq_plot()
library(dplyr)
df <- hai_scale_zero_one_vec(.x = mtcars$mpg) %>%
hai_distribution_comparison_tbl()
tidy_density_tbl <- hai_get_density_data_tbl(df)
hai_density_plot(
.data = tidy_density_tbl,
.dist_name_col = distribution,
.x_col = x,
.y_col = y,
.alpha = 0.5,
.interactive = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.