layout_name_fn() returns a function that takes nrow and ncol arguments and generates a character vector of nrow * ncol names. Intended for use with layout_grid().
Usage
layout_name_fn(prefix = "piece.", from = 1L, width = 1L, flag = "0")
Arguments
- prefix
Prefix for the generated names.
- from
Starting number for the generated name suffix.
- width, flag
Passed to formatC().
Value
A function with arguments nrow and ncol that would return a character vector of length nrow * ncol.
Examples
layout_name_fn()(nrow = 3, ncol = 3)
#> [1] "piece.1" "piece.2" "piece.3" "piece.4" "piece.5" "piece.6" "piece.7"
#> [8] "piece.8" "piece.9"
layout_name_fn("back_", from = 97, width = 3L)(nrow = 2, ncol = 3)
#> [1] "back_097" "back_098" "back_099" "back_100" "back_101" "back_102"