Learn R Programming

chronicle (version 0.1.0)

add_chunk: Transforms a function call into an Rmarkdown chunk

Description

Transforms a function call into an Rmarkdown chunk

Usage

add_chunk(
  report = NULL,
  dt_expr = NULL,
  fun,
  params,
  chunk_title = NULL,
  title_level = 2,
  echo = FALSE,
  message = FALSE,
  warning = FALSE,
  fig_width = NULL,
  fig_height = NULL
)

Arguments

report

Character string containing the text of an Rmarkdown report header (and possibly more chunks). Easily create one with chronicle::new_report(), and if NULL, this will be the default value.

dt_expr

Expression of the table to run function on.

fun

Function to call.

params

List of parameters to be passed to fun.

chunk_title

Title of the Rmarkdown chunk. If NULL, chronicle will try to parse a generic title based on the function and parameters passed using make_title()

title_level

Level of the section title of this plot (ie, number of # on Rmarkdown syntax.)

echo

Whether to display the source code in the output document. Default is FALSE.

message

Whether to preserve messages on rendering. Default is FALSE.

warning

Whether to preserve warnings on rendering. Default is FALSE.

fig_width

Width of the plot (in inches).

fig_height

Height of the plot (in inches).

Value

An rmarkdown chunk as a character string.