Generates a .rmd file containing a mathematical description of the proto_ipm object.

make_ipm_report(
  object,
  rmd_dest = getwd(),
  title = "",
  output_format = "html",
  render_output = FALSE,
  block_eqs = TRUE,
  long_eq_length = 65
)

# Default S3 method
make_ipm_report(
  object,
  rmd_dest = getwd(),
  title = "",
  output_format = "html",
  render_output = FALSE,
  block_eqs = TRUE,
  long_eq_length = 65
)

# S3 method for class 'ipmr_ipm'
make_ipm_report(
  object,
  rmd_dest = getwd(),
  title = "",
  output_format = "html",
  render_output = FALSE,
  block_eqs = TRUE,
  long_eq_length = 65
)

make_ipm_report_body(proto_ipm, block_eqs, rmd_dest, long_eq_length)

Arguments

object

A proto_ipm or output from make_ipm().

rmd_dest

The folder to save the Rmd file at. The default is getwd(). Alternatively, can be a complete file path that specifies the location and title of the document with the extension ".rmd". in this case, the current date will be appended to the title.

title

The title to include in the document. This is not necessarily the same as rmd_dest, as this appears at the top of the generated report, and is not included in the file path!

output_format

The format to include in the YAML header for the created .rmd document.

render_output

A logical indicating whether to call rmarkdown::render on the generated .rmd file. Often times, the .rmd file will need further editing before it's useful, so the default is FALSE.

block_eqs

A logical. If TRUE, all equations will be inserted with blocks and numbered using tag{}. If FALSE, equations will be rendered as inline equations on a single line, and numbered as 1.1, 1.2, 1.3 (iteration expressions), 2.1, 2.2 (vital rate expressions), etc.

long_eq_length

For longer equations, make_ipm_report tries to wrap these into multiple lines using \\. This parameter controls the number of characters per line. Default is 65. Ignored when block_eqs = FALSE.

proto_ipm

A proto_ipm object. Only used for make_ipm_report_body.

Value

For make_ipm_report, the filepath to the .rmd file. The default name is "ipmr_report_<current_date>.rmd". For make_ipm_report_body, a character vector with Markdown and LaTeX suitable for rendering, but without a header.

Details

make_ipm_report_body only translates the iteration expressions and vital rate expressions into Markdown with LaTeX, and does not produce any headers needed to knit the file. This function is exported mostly for re-usage in pdb_report, and isn't really intended for use by ipmr users.

Translations

For iteration expressions, vital rate expressions, and parameter names, make_ipm_report first translates all values in the data_list to beta_X. For example, s = surv_int + surv_slope * z_1 is translated into beta_0 + beta_1 * z_1, and then is translated into LaTeX equations. Since everything is call beta_X, a glossary is provided at the end of each report that matches betas to their names in the data_list.