dq_report_by {dataquieR} | R Documentation |
Generate a stratified full DQ report
Description
Generate a stratified full DQ report
Usage
dq_report_by(
study_data,
item_level = "item_level",
meta_data_segment = "segment_level",
meta_data_dataframe = "dataframe_level",
meta_data_cross_item = "cross-item_level",
meta_data_item_computation = "item_computation_level",
missing_tables = NULL,
label_col,
meta_data_v2,
segment_column = NULL,
strata_column = NULL,
strata_select = NULL,
selection_type = NULL,
segment_select = NULL,
segment_exclude = NULL,
strata_exclude = NULL,
subgroup = NULL,
resp_vars = character(0),
id_vars = NULL,
advanced_options = list(),
storr_factory = NULL,
amend = FALSE,
...,
output_dir = NULL,
input_dir = NULL,
also_print = FALSE,
disable_plotly = FALSE,
view = TRUE,
meta_data = item_level,
cross_item_level,
`cross-item_level`,
segment_level,
dataframe_level,
item_computation_level
)
Arguments
study_data |
data.frame the data frame that contains the measurements:
it can be an R object (e.g., |
item_level |
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 if |
meta_data_cross_item |
data.frame – optional: Cross-item level metadata |
meta_data_item_computation |
data.frame – optional: Computed items metadata |
missing_tables |
character the name of the data frame containing the
missing codes, it can be a vector if more
than one table is provided. Example:
|
label_col |
variable attribute the name of the column in the metadata containing the labels of the variables |
meta_data_v2 |
character path or file name of the workbook like
metadata file, see
|
segment_column |
variable attribute name of a metadata attribute usable to split the report in sections of variables, e.g. all blood-pressure related variables. By default, reports are split by STUDY_SEGMENT if available and no segment_column nor strata_column or subgroup are defined. To create an un-split report please write explicitly the argument 'segment_column = NULL' |
strata_column |
variable name of a study variable to stratify the
report by, e.g. the study centers.
Both labels and |
strata_select |
character if given, the strata of strata_column are limited to the content of this vector. A character vector or a regular expression can be provided (e.g., "^a.*$"). This argument can not be used if no strata_column is provided |
selection_type |
character optional, can only be specified if a
|
segment_select |
character if given, the levels of segment_column are limited to the content of this vector. A character vector or a regular expression (e.g., ".*_EXAM$") can be provided. This argument can not be used if no segment_column is provided. |
segment_exclude |
character optional, can only be specified if a
|
strata_exclude |
character optional, can only be specified if a
|
subgroup |
character optional, to define subgroups of cases. Rules are
to be written as |
resp_vars |
variable the names of the measurement variables, if
missing or |
id_vars |
variable a vector containing the name/s of the variables
containing ids, to
be used to merge multiple data frames if provided
in |
advanced_options |
list options to set during report computation,
see |
storr_factory |
function |
amend |
logical if there is already data in. |
... |
arguments to be passed through to dq_report or dq_report2 |
output_dir |
character if given, the output is not returned but saved in this directory |
input_dir |
character if given, the study data files that have
no path and that are not URL are searched in
this directory. Also |
also_print |
logical if |
disable_plotly |
logical do not use |
view |
logical open the returned report |
meta_data |
data.frame old name for |
cross_item_level |
data.frame alias for |
segment_level |
data.frame alias for |
dataframe_level |
data.frame alias for |
item_computation_level |
data.frame alias for
|
`cross-item_level` |
data.frame alias for |
Value
invisible()
. named list of named lists of dq_report2 reports
or, if output_dir
has been specified, invisible(NULL)
See Also
Examples
## Not run: # really long-running example.
prep_load_workbook_like_file("meta_data_v2")
rep <- dq_report_by("study_data", label_col =
LABEL, strata_column = "CENTER_0")
rep <- dq_report_by("study_data",
label_col = LABEL, strata_column = "CENTER_0",
segment_column = NULL
)
unlink("/tmp/testRep/", force = TRUE, recursive = TRUE)
dq_report_by("study_data",
label_col = LABEL, strata_column = "CENTER_0",
segment_column = STUDY_SEGMENT, output_dir = "/tmp/testRep"
)
unlink("/tmp/testRep/", force = TRUE, recursive = TRUE)
dq_report_by("study_data",
label_col = LABEL, strata_column = "CENTER_0",
segment_column = NULL, output_dir = "/tmp/testRep"
)
dq_report_by("study_data",
label_col = LABEL,
segment_column = STUDY_SEGMENT, output_dir = "/tmp/testRep"
)
dq_report_by("study_data",
label_col = LABEL,
segment_column = STUDY_SEGMENT, output_dir = "/tmp/testRep",
also_print = TRUE
)
dq_report_by(study_data = "study_data", meta_data_v2 = "meta_data_v2",
advanced_options = list(dataquieR.study_data_cache_max = 0,
dataquieR.study_data_cache_metrics = TRUE,
dataquieR.study_data_cache_metrics_env = environment()),
cores = NULL, dimensions = "int")
dq_report_by(study_data = "study_data", meta_data_v2 = "meta_data_v2",
advanced_options = list(dataquieR.study_data_cache_max = 0),
cores = NULL, dimensions = "int")
## End(Not run)