create_xlsx_overview: Create an Excel workbook providing an overview with...

View source: R/create_xlsx_overview.R

create_xlsx_overviewR Documentation

Create an Excel workbook providing an overview with descriptive statistics and correlations

Description

This function uses the openxlsx package to create an Excel workbook with multiple sheets that contain descriptive statistics and correlations for a specified variable set. There are options to specify a) a grouping variable to include descriptive statistics that are calculated separately by group and b) up to two cluster identifiers to compute multilevel correlations between the respective group means at the specified hierarchical levels.

Usage

create_xlsx_overview(
  data,
  .cols,
  .file = "overview.xlsx",
  .group = NULL,
  .id_cluster_l2 = NULL,
  .id_cluster_l3 = NULL,
  .round = 3
)

Arguments

data

A data frame.

.cols

<data-masked> The names or column numbers of the numeric variables to create the overview for.

.file

A character string specifying the file name and the path where to save the .xlsx file. The default is to save an .xlsx file named 'overview' in the current working directory.

.group

<data-masked> Optional. The name or column number of the grouping variable to compute descriptive statistics by group. The default is NULL.

.id_cluster_l2

<data-masked> Optional. The name or column number of the identifier for the second hierarchical level (e.g., classrooms). The default is NULL.

.id_cluster_l3

<data-masked> Optional. The name or column number of the identifier for the third hierarchical level (e.g., schools). The default is NULL.

.round

Optional. An integer constant indicating the number of digits for rounding the results. The default is to print 3 digits.

Value

An Excel workbook (as .xlsx file) saved in .file with multiple sheets providing an overview with descriptive statistics and correlations for the variables specified in .cols.

See Also

See the openxlsx package.

Examples

## Not run: 
create_xlsx_overview(data = studach, .cols = gender:read,
.file = "student_achievement_overview.xlsx",
.group = ts, .id_cluster_l2 = id_cla, .id_cluster_l3 = id_sch,
.round = 3)

## End(Not run)

sophiestallasch/multides documentation built on Oct. 20, 2024, 5:14 a.m.