footnote() attaches footnotes to selected cells. It adds a reference symbol to each targeted cell and appends the corresponding note text as a new row in the footer.
Function signature
Parameters
A
flextable object.Row selector. Accepts integer indices, a one-sided formula (e.g.,
~ col > 5), or a logical vector.Column selector. Accepts integer indices, column names, a formula, or a logical vector.
A call to
as_paragraph(). Each element of the paragraph corresponds to a cell targeted by the i/j selectors.Symbols to append to the selected cells as reference markers (e.g.,
c("a", "b", "c") or c("*", "**")). When a single symbol is provided, it is reused across all targeted cells.Which part of the table contains the target cells:
"body", "header", or "footer". The value "all" is not allowed.If
TRUE, append the new footnote on the same footer row as the preceding footnote rather than creating a new row.Separator used between footnotes when
inline = TRUE.Separator inserted between multiple footnote symbols in the same cell. For example,
"," produces 1,2 instead of 12.Return value
The modifiedflextable object.
Examples
Add three footnotes to the header row:See also
as_paragraph()— build the footnote contentadd_footer_lines()— add plain footer rowscompose()— set arbitrary cell content