Depending on your column selection, different types of plots and tables are generated. See plot_metrics and tab_metrics.
Usage
report_metrics(
data,
cols,
cross = NULL,
metric = FALSE,
...,
index = FALSE,
factors = FALSE,
clusters = FALSE,
model = FALSE,
effect = FALSE,
title = TRUE,
close = TRUE,
clean = TRUE
)
Arguments
- data
A data frame.
- cols
A tidy column selection, e.g. a single column (without quotes) or multiple columns selected by methods such as starts_with().
- cross
Optional, a grouping or correlation column (without quotes).
- metric
When crossing variables, the cross column parameter can contain categorical or metric values. By default, the cross column selection is treated as categorical data. Set metric to TRUE, to treat it as metric and calculate correlations. Alternatively, for multivariable models (if the model parameter is TRUE), provide the metric column selection in the metric parameter and the categorical column selection in the cross parameter.
- ...
Parameters passed to the plot_metrics and tab_metrics and effect_metrics functions.
- index
When the cols contain items on a metric scale (as determined by get_direction), an index will be calculated using the 'psych' package. Set to FALSE to suppress index generation.
- factors
The number of factors to calculate. Set to FALSE to suppress factor analysis. Set to TRUE to output a scree plot and automatically choose the number of factors. When the cols contain items on a metric scale (as determined by get_direction), factors will be calculated using the 'psych' package. See add_factors.
- clusters
The number of clusters to calculate. Cluster are determined using kmeans after scaling the items. Set to FALSE to suppress cluster analysis. Set to TRUE to output a scree plot and automatically choose the number of clusters based on the elbow criterion. See add_clusters.
- model
Set to TRUE for multivariable models. The dependent variable must be provided in the first parameter (cols). Independent categorical variables are provided in the second parameter (cross), which supports tidy column selections or vectors of multiple columns. Independent metric variables are provided in the metric parameter as tidy column selections or vectors of multiple columns. Interaction terms are provided in the interactions parameter and passed to the model functions. You can get diagnostic plots by setting the diagnostics parameter to TRUE. See model_metrics_tab, model_metrics_plot and add_model for further options.
- effect
Whether to report statistical tests and effect sizes. See effect_counts for further parameters.
- title
A character providing the heading or TRUE (default) to output a heading. Classes for tabset pills will be added.
- close
Whether to close the last tab (default value TRUE) or to keep it open. Keep it open to add further custom tabs by adding headers on the fifth level in Markdown (e.g. ##### Method).
- clean
Prepare data by data_clean.