| walk_regions | R Documentation |
This applies a .fun to all named regions in a workbook names match
.pattern. This is especially useful since as_workbook() methods for
Tatoo_tables add named regions for certain parts of the Table. See also
vignette("named_regions") for how the names of named regions are
constructed by tatoo.
walk_regions(.wb, .pattern = ".*", .fun, ...)
map_regions(.wb, .pattern = ".*", .fun, ...)
.wb |
an openxlsx |
.pattern |
|
.fun |
A function with the formal arguments |
... |
passed on to |
walk_regions returns .wb. map_regions returns a modified copy
of .wb
x <- iris
title(iris) <- "Iris example table"
wb <- as_workbook(iris)
regions(wb) # display regions
# Apply a style
# Keep in mind that openxlsx functions modify worksheets by reference.
# If you do not want this behaviour you can use map_regions instead.
style <- openxlsx::createStyle(textDecoration = "bold")
walk_regions(
wb,
.pattern = "colnames.*",
.fun = openxlsx::addStyle,
style = style
)
## Not run:
openxlsx::openXL(wb)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.