Description Usage Arguments Details Value Examples
View source: R/plot_sum_stats.R
Calculates the conditional mean, variance, skewness and kurtosis for continuous variables based on a range of quantiles of a given continuous variable and displays them as line plots.
1 2 | plot_sum_stats(dataset, given_var, stats = c(1, 2, 3, 4),
n_quantiles = 5)
|
dataset |
A data frame. Factors and logicals will be removed. |
given_var |
A variable from your |
stats |
Vector of summary statistics you want to plot. |
n_quantiles |
Number of quantiles you want to partition |
The function will return one plot for each of the chosen summary statistics. The values will be displayed as line plots, each point representing the value of the statistic conditioned on a specific quantile of the given variable.
You can choose the way you indicate which summary statistics you want to plot. One way is to express the stats as numerics (1 = mean, 2 = variance, 3 = skewness, 4 = kurtosis) or as strings in a vector (as a subset of c("mean", "var", "skewness", "kurtosis")).
One plot for each statistic, showing all numeric variables conditioned
on the given variable on a grid. The results will open in one window per
statistic when using plot_sum_stats()
in RStudio.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.