dq_report_by: Generate a stratified full DQ report

View source: R/dq_report_by.R

dq_report_byR Documentation

Generate a stratified full DQ report

Description

Generate a stratified full DQ report

Usage

dq_report_by(
  study_data,
  meta_data = "item_level",
  meta_data_segment = "segment_level",
  meta_data_dataframe = "dataframe_level",
  meta_data_cross_item = "cross-item_level",
  label_col,
  meta_data_v2,
  meta_data_split = STUDY_SEGMENT,
  study_data_split,
  ...,
  v1.0 = FALSE,
  output_dir = NULL,
  also_print = FALSE
)

Arguments

study_data

data.frame the data frame that contains the measurements

meta_data

data.frame the data frame that contains metadata attributes of study data

meta_data_segment

data.frame – optional: Segment level metadata

meta_data_dataframe

data.frame – optional: Data frame level metadata

meta_data_cross_item

data.frame – optional: Cross-item level metadata

label_col

variable attribute the name of the column in the metadata with labels of variables

meta_data_v2

character path to workbook like metadata file, see prep_load_workbook_like_file for details. ALL LOADED DATAFRAMES WILL BE PURGED, using prep_purge_data_frame_cache, if you specify meta_data_v2.

meta_data_split

variable attribute name of a metadata attribute to split the report in sections of variables, e.g. all blood- pressure. By default, reports are split by STUDY_SEGMENT if available.

study_data_split

variable Name of a study variable to stratify the report by, e.g. the study centers.

...

arguments to be passed through to dq_report or dq_report2

v1.0

logical if TRUE, create old dq_report reports, use dq_report2, otherwise

output_dir

character if given, the output is not returned but

also_print

logical if output_dir is not NULL, also create HTML output for each segment using print.dataquieR_resultset2(). written to the path output_dir

Value

named list of named lists of dq_report2 reports or, if output_dir has been specified, invisible(NULL)

See Also

dq_report

Examples

## Not run:  # really long-running example.
prep_load_workbook_like_file("meta_data_v2")
rep <- dq_report_by("study_data", label_col =
  LABEL, study_data_split = "CENTER_0")
rep <- dq_report_by("study_data",
  label_col = LABEL, study_data_split = "CENTER_0",
  meta_data_split = NULL
)
unlink("/tmp/testRep/", force = TRUE, recursive = TRUE)
dq_report_by("study_data",
  label_col = LABEL, study_data_split = "CENTER_0",
  meta_data_split = STUDY_SEGMENT, output_dir = "/tmp/testRep"
)
unlink("/tmp/testRep/", force = TRUE, recursive = TRUE)
dq_report_by("study_data",
  label_col = LABEL, study_data_split = "CENTER_0",
  meta_data_split = NULL, output_dir = "/tmp/testRep"
)
dq_report_by("study_data",
  label_col = LABEL,
  meta_data_split = STUDY_SEGMENT, output_dir = "/tmp/testRep"
)
dq_report_by("study_data",
  label_col = LABEL,
  meta_data_split = STUDY_SEGMENT, output_dir = "/tmp/testRep",
  also_print = TRUE
)

## End(Not run)

dataquieR documentation built on July 26, 2023, 6:10 p.m.