View source: R/tablesggOpt.bare.R
tablesggSetOpt | R Documentation |
Set the values of package options.
tablesggSetOpt(...)
... |
Arguments in |
The new option values persist until the end of the R session or until they
are changed by another call to this function or to
tablesggOpt(reset=TRUE)
.
The options that may be set are:
A styleObj
object, with element type
entry
. This is the default style for table entries.
A styleObj
object, with element type
block
. This is the default style for blocks.
A
styleObj
object, with element type hvrule
. This is the
default style for hvrules.
A numeric vector of length 4, containing the amount of empty space to add around the four sides of a plotted table, in millimeters. The order of sides is top, right, bottom, left.
Logical scalar. If TRUE then text for table
entries is allowed to contain markdown and HTML tags to control its
appearance. TRUE is valid only if package ggtext
is available.
Logical scalar. If TRUE then automatic wrapping of text
for table entries is allowed. TRUE is valid only if packages
ggtext
and quadprog
are available.
Facilities to handle markdown and automatic wrapping of entry text are
provided by Claus Wilke's ggtext
package
(https://CRAN.R-project.org/package=ggtext). Therefore
allowMarkdown
and allowWrap
can be set to TRUE only when
that package has been installed. Note that only a subset of HTML tags are
available.
A list with the old values of the named options, invisibly.
tablesggOpt
to get current values of options, or to reset
options to their "factory-fresh" setting. styles_pkg
for
the set of package-provided table styles.
oldopt <- tablesggOpt()
tablesggOpt(reset=TRUE)
plt1 <- plot(iris2_tab, title="Factory-fresh default styles")
# Set new default style for table entries:
tablesggSetOpt(entryStyle=styles_pkg$entryStyle_pkg_2)
plt2 <- plot(iris2_tab, title="Changed default entry style")
# Compare:
print(plt1, vpy=0.75)
print(plt2, vpy=0.25, newpage=FALSE)
# Change the values of multiple options:
tablesggSetOpt(list(hvruleStyle=styles_pkg$hvruleStyle_pkg_base,
plot.margin=c(5, 5, 5, 5)))
# ... plot some tables using the new defaults ...
# Restore the old options:
tablesggSetOpt(oldopt)
identical(tablesggOpt(), oldopt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.