Skip to contents

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,
  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.

...

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.

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.

Value

A volker report object.

Details

For item batteries, an index is calculated and reported. When used in combination with the Markdown-template "html_report", the different parts of the report are grouped under a tabsheet selector.

[Experimental]

Examples

library(volker)
data <- volker::chatgpt

report_metrics(data, sd_age)

#> 
#> 
#> |Age    | value|
#> |:------|-----:|
#> |min    |    18|
#> |q1     |    27|
#> |median |    38|
#> |q3     |    52|
#> |max    |    68|
#> |mean   |  39.7|
#> |sd     |  13.8|
#> |n      |   101|