| plot_vector | R Documentation |
Create Plot Vector
plot_vector(
output = "html",
fun = NULL,
data = NULL,
color = "black",
xlim = NULL,
height = 1,
height_plot = 400,
width_plot = 1200,
images = NULL,
sprintf = "%s",
assets = "tinytable_assets",
...
)
output |
Output format. One of "html", "latex", "typst", "markdown", etc. |
fun |
String or function to generate inline plots.
|
data |
a list of data frames or vectors to be used by the plotting functions in |
color |
string Name of color to use for inline plots (passed to the |
xlim |
Numeric vector of length 2. Controls the range of bar plots. |
height |
Numeric, the height of the images in the table in em units. |
height_plot |
Numeric, the height of generated plot images in pixels (default: 400). |
width_plot |
Numeric, the width of generated plot images in pixels (default: 1200). |
images |
Character vector, the paths to the images to be inserted. Paths are relative to the main table file or Quarto (Rmarkdown) document. |
sprintf |
Character string, a sprintf format string to format the generated cell content. Default is "%s" which displays the content as-is. Use this to wrap images or plots in custom markup. |
assets |
Path to the directory where generated assets are stored. This path is relative to the location where a table is saved. |
... |
Extra arguments are passed to the function in |
This function creates plots by creating a temporary tt() object and applying plot_tt(). It returns a character vector containing the image paths or HTML tags for the plots.
A character vector with plot file paths or HTML tags.
## Not run:
# Create histogram plots
plot_data <- list(rnorm(100), rnorm(50))
plot_vector(fun = "histogram", data = plot_data, output = "html")
# Create density plots
plot_vector(fun = "density", data = plot_data, output = "latex")
# Create bar plots from single values
bar_data <- list(0.5, 0.8, 0.3)
plot_vector(fun = "barpct", data = bar_data, output = "html")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.