This function creates an automatic report according to a predefined template in the package or a user-generated template. Create a report from a targeter report object
This function creates an automatic report according to a predefined template in the package or a user-generated template. Create a report from a targeter tree object
Usage
report(object, ...)
# S3 method for class 'targeter'
report(
object,
summary_object = NULL,
metadata = NULL,
metadata_vars = list(varname = "variable", varlabel = "label"),
format = "html",
nmax = 100,
template = NULL,
quarto_root_dir = ".",
quarto_targeters_project_dir = "targeter-reports",
quarto_project_template = getOption("targeter.template",
file.path(find.package("targeter", lib.loc = .libPaths()), "ressources",
"_targeter_project_default.yml")),
quarto_project_brandfile = getOption("targeter.brandfile",
file.path(find.package("targeter", lib.loc = .libPaths()), "ressources",
"_targeter_brand_default.yml")),
targeter_sub_folder = tar_foldername(object),
pptx_reference_doc = NULL,
output_file = targeter_sub_folder,
title = object$analysis,
author = getOption("targeter.author", "wlds targeter"),
fullplot_which_plot = "1:2",
fullplot_numvar_as = "bin",
show_tables = FALSE,
show_toc = TRUE,
show_details = TRUE,
debug = FALSE,
render = TRUE,
logo = NULL,
freeze = TRUE,
verbose = FALSE,
custom_fields = list(freeze = freeze),
report_categories = c("profile"),
...
)
# S3 method for class 'tartree'
report(
object,
profiles = TRUE,
metadata = NULL,
metadata_vars = list(varname = "variable", varlabel = "label"),
format = "html",
template = NULL,
quarto_root_dir = ".",
quarto_targeters_project_dir = "targeter-reports",
quarto_project_template = getOption("targeter.template",
file.path(find.package("targeter", lib.loc = .libPaths()), "ressources",
"_targeter_project_default.yml")),
quarto_project_brandfile = getOption("targeter.brandfile",
file.path(find.package("targeter", lib.loc = .libPaths()), "ressources",
"_targeter_brand_default.yml")),
targeter_sub_folder = tar_foldername(object),
pptx_reference_doc = NULL,
output_file = tar_foldername(object),
title = paste0(attr(object, "tar_object")$analysis, " - decision tree"),
author = getOption("targeter.author", "wlds targeter"),
render = TRUE,
freeze = TRUE,
debug = FALSE,
verbose = FALSE,
custom_fields = list(freeze = freeze),
report_categories = c("tree"),
...
)Arguments
- object
- an object of class targeter tartree
- ...
additional parameters to be passed to quarto, for instance allowing to pass/overwite any YAML set-up
- summary_object
an object of class "summary.targeter": pre-computed summary of object.
- metadata
- data.frame - if metadata is loaded in R environment, label of the variables can be used. Default value (NULL) corresponds to no metadata available. The label will be used for the title and the x-axis of the graph.
- metadata_vars
- list of two character strings: varname and varlabel. Default to varname="variable", varlabel="label". Used to specify the columns in metadata that contains variable names and labels.
- format
- Target output format (defaults to "html"). The option "all" will render all formats.
- nmax
- integer: maximum number of variables to be used. Default 100. use NULL to force all variables to be present in report.See notes.
- template
- character. path to a Quarto qmd document that will be used to generate presentation. If NULL (default), we will use targeter package default template.
- quarto_root_dir
(default "./targeter-reports") Path to a root folder where quarto project folder will be avaible. Default to "." so that calling targeter first time in an analyses project will initiate everything for user.
- quarto_targeters_project_dir
(default "targeter-reports", within quarto_root_dir) Path to a folder where all targeter reports will be stored. Using a pre-existing projetc allows benfiting from its settings. (you might want to put brand_file to empty or use your own brand file)
- quarto_project_template
- character. Path to a default Quarto template that will be used as Quarto reference-doc for all formats. If NULL (default), we will use targeter package default templates.
- quarto_project_brandfile
- character. Path to a default Quarto brandfile that will be used as Quarto reference-doc for all formats. If NULL (default), we will use targeter package default brandfile.
- targeter_sub_folder
- character. Output directory - default to create a new dedicated directory in working folder.
- pptx_reference_doc
- character. Path to a default PPTX template that will be used as Quarto reference-doc for pppx formzt If NULL (default), we will use targeter package default templates for PPTX. If empty string "", we won't use any template.
- output_file
- character, name of output file (without file extension). default value: index
- title
- character, title for the presentation. Overide default title that consists in taking title for targeter object 'analysis' slot.
- character: presentatiopn author.
- fullplot_which_plot
- character, selection of plots (cf `fullplot` documentation)
- fullplot_numvar_as
- character, one of "bin" or "value" (cf `fullplot` documentation)
- show_tables
- logical whetheer to print tables in seprate slides in addition of graphics. Might ot produce nice outputs as tables are usually large.
- show_toc
- logical. If TRUE (default), a table of content will be generated. If FALSE, no table of content will be generated.
- show_details
- logical. If TRUE (default), some more information will be displayed in the report.
- debug
- logical. If TRUE, the function will print debug information (passed to Quarto call).
- render
- logical. If TRUE (default), the report will be rendered and saved in the target_sub_folder. If FALSE, the report will be generated but not rendered. Useful for debugging.
- logo
- character: path to a logo file. If NULL (default), we will take package welovedatascience logo. If empty, no logo will be used. Only used by revealjs format.
- freeze
- logical: default TRUE. If TRUE, the report will be frozen (no more changes can be made). If FALSE, the report will be editable. Frozen reports renders can always be bypassed by explicit call to quarto.
- verbose
- logical. If TRUE, the function will print some information along the process
- custom_fields
- list of custom fields to be added to the report.
- report_categories
- list of categories / tags to be used for report USeful if you want to classfiy reports as your Quarto project reports listing could make use of categories (which is the case of default targeter template)
- profiles
- logical: do we display targeter profiles's graph for variables associated to tree.
Value
invisibly returns path to the generated specific file (unique format) or folder (several formats)
invisibly returns path to the generated specific file (unique format) or folder (several formats)