Generate single-page match summary report
Usage
vr_match_summary(
x,
outfile,
refx,
vote = TRUE,
format = "html",
icon = NULL,
css = vr_css(),
remove_nonplaying = TRUE,
style = "default",
update_meta = FALSE,
home_players = TRUE,
visiting_players = TRUE,
base_font_size = 11,
court_plots_function = "vr_court_plots",
court_plots_args = list(),
plot_icons,
skill_evaluation_decode = "guess",
single_page_tries = 1L,
shiny_progress = FALSE,
chrome_print_extra_args = NULL,
...
)
vr_css()
Arguments
- x
datavolley or string: as returned by
datavolley::dv_read
, or the path to such a file- outfile
string: path to file to produce (if not specified, will create a file in the temporary directory)
- refx
data.frame: some choices of
style
require a reference data set to calculate e.g. expected SO. This should be from comparison matches (e.g. all matches from the same league), and should be a data.frame of the plays components from those matches. If missing, expected SO and BP will be replaced by reception and serve efficiency- vote
logical: include vote report component? If not explicitly specified,
vote
might be set to FALSE depending onstyle
- format
string: "pdf" (using latex-based PDF), "paged_pdf" (using pagedown-based PDF), "png", "paged_png", or "html"
- icon
string: (optional) filename of icon image to use
- css
list: css specifications for some elements, giving (currently fairly limited) control over appearance. See the output of
vr_css
for an example. Note that some styling does not seem to be applied when exporting to PDF- remove_nonplaying
logical: if
TRUE
, remove players from the team summaries that did not take to the court- style
string: can be
"default" - the standard FIVB match report
"ov1" - modified version of "default" with score evolution plot, different breakdown by rotation, and other changes
- update_meta
logical: should we update the match metadata before generating the report? Updating the match metadata will recalculate details such as set scores, player starting positions and substitution summaries, and set durations from the scouted play-by-play data
- home_players
logical: include a table with individual player statistics for the home team?
- visiting_players
logical: include a table with individual player statistics for the visiting team?
- base_font_size
numeric: the base font size (the font sizes in different parts of the report are scaled relative to this)
- court_plots_function
string or function: a function, or name of a function, that takes a datavolley object and produces a plot object. Supply your own function here to override the court plots that are included in the report for some values of
style
- court_plots_args
list: named list of arguments to pass to the court plot function
- plot_icons
logical or data.frame: some values of
style
will include plots of various kinds in the report. Currentlyplot_icons
defaults toTRUE
forstyle = "ov1"
on a beach match, otherwiseFALSE
(plot icons generally tend to be visually distracting with indoor, particularly the error icons). Setplot_icons
toFALSE
for no icons,TRUE
to use the icons specified byvr_plot_icons()
, or a data.frame as returned byvr_plot_icons()
to control the icons that will be used. Note that only (free) fontawesome icons are supported- skill_evaluation_decode
: as for
datavolley::dv_read()
- single_page_tries
integer: experimental! Ideally we want a single-page report, but until the report is rendered to PDF we don't know for sure whether it will fit on one page. If
single_page_tries
is greater than 1, we will try re-rendering the report (trying up to this many times). If it does not fit on a single page, thebase_font_size
will be progressively reduced on each try. Note that this only applies toformat
"paged_pdf"- shiny_progress
logical: if
TRUE
, the report generation process will issueshiny::setProgress()
calls. The call tovr_match_summary
should therefore be wrapped in ashiny::withProgress()
scope- chrome_print_extra_args
character: additional parameters to pass as
extra_args
topagedown::chrome_print()
(only relevant if using a "paged_*" format)- ...
: additional parameters passed to the rmarkdown template
Examples
if (FALSE) {
f <- vr_match_summary(dv_example_file(), format = "paged_pdf")
if (interactive()) browseURL(f)
}