Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

chunk_dataframe

create a chunk representation suitable for flextable


Description

This function is to be used by external packages that want to provide an object that can be inserted as a chunk object in paragraphs of a flextable object.

Usage

chunk_dataframe(...)

Arguments

...

values to set.

Value

a data.frame with an additional class "chunk" that makes it suitable for beeing used in as_paragraph()

text pattern with default values

chunk_dataframe(txt = c("any text", "other text"))

text pattern with bold set to TRUE

chunk_dataframe(
  txt = c("any text", "other text"),
  bold = c(TRUE, TRUE))

text pattern with control over all formatting properties

chunk_dataframe(
  txt = c("any text", "other text"),
  font.size = c(12, 10),
  italic = c(FALSE, TRUE),
  bold = c(FALSE, TRUE),
  underlined = c(FALSE, TRUE),
  color = c("black", "red"),
  shading.color = c("transparent", "yellow"),
  font.family = c("Arial", "Arial"),
  hansi.family = c("Arial", "Arial"),
  eastasia.family = c("Arial", "Arial"),
  cs.family = c("Arial", "Arial"),
  vertical.align = c("top", "bottom") )

text with url pattern

chunk_dataframe(
  txt = c("any text", "other text"),
  url = rep("https://www.google.fr", 2),
  font.size = c(12, 10),
  italic = c(FALSE, TRUE),
  bold = c(FALSE, TRUE),
  underlined = c(FALSE, TRUE),
  color = c("black", "red"),
  shading.color = c("transparent", "yellow"),
  font.family = c("Arial", "Arial"),
  hansi.family = c("Arial", "Arial"),
  eastasia.family = c("Arial", "Arial"),
  cs.family = c("Arial", "Arial"),
  vertical.align = c("top", "bottom") )

images pattern

chunk_dataframe(width = width, height = height, img_data = files )

flextable

Functions for Tabular Reporting

v0.6.10
GPL-3
Authors
David Gohel [aut, cre], Clementine Jager [ctb], Quentin Fazilleau [ctb], Maxim Nazarov [ctb] (rmarkdown for docx output), Titouan Robert [ctb], Michael Barrowman [ctb] (inline footnotes), Atsushi Yasumoto [ctb] (support for bookdown cross reference), Paul Julian [ctb] (support for gam objects)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.