A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://davidgohel.github.io/flextable/reference/plot_chunk.html below:

Mini plots chunk wrapper — plot_chunk • flextable

Usage
plot_chunk(
  value,
  width = 1,
  height = 0.2,
  type = "box",
  free_scale = FALSE,
  unit = "in",
  ...
)
Arguments
value

a numeric vector, stored in a list column.

width, height

size of the resulting png file in inches

type

type of the plot: 'box', 'line', 'points' or 'density'.

free_scale

Should scales be free (TRUE or FALSE, the default value).

unit

unit for width and height, one of "in", "cm", "mm".

...

arguments sent to plot functions (see par())

Note

This chunk option requires package officedown in a R Markdown context with Word output format.

PowerPoint cannot mix images and text in a paragraph, images are removed when outputing to PowerPoint format.

See also

Other chunk elements for paragraph: as_b(), as_bracket(), as_chunk(), as_equation(), as_highlight(), as_i(), as_image(), as_sub(), as_sup(), as_word_field(), colorize(), gg_chunk(), grid_chunk(), hyperlink_text(), linerange(), minibar()

Examples
library(data.table)
library(flextable)

z <- as.data.table(iris)
z <- z[, list(
  Sepal.Length = mean(Sepal.Length, na.rm = TRUE),
  z = list(.SD$Sepal.Length)
), by = "Species"]

ft <- flextable(z,
  col_keys = c("Species", "Sepal.Length", "box", "density")
)
ft <- mk_par(ft, j = "box", value = as_paragraph(
  plot_chunk(
    value = z, type = "box",
    border = "red", col = "transparent"
  )
))
ft <- mk_par(ft, j = "density", value = as_paragraph(
  plot_chunk(value = z, type = "dens", col = "red")
))
ft <- set_table_properties(ft, layout = "autofit", width = .6)
ft <- set_header_labels(ft, box = "boxplot", density = "density")
theme_vanilla(ft)

           

Species

Sepal.Length

boxplot

density

setosa

5.006

versicolor

5.936

virginica

6.588


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4