sync_vector {rock} | R Documentation |
Sync (expand or compress) a vector
Description
Sync (expand or compress) a vector
Usage
sync_vector(
x,
newLength,
sep = " ",
fill = TRUE,
compressFun = NULL,
expandFun = NULL,
compressFunPart = NULL,
silent = rock::opts$get("silent")
)
Arguments
x |
The vector |
newLength |
The new length |
sep |
When not specifying |
fill |
When expanding streams, whether to duplicate elements to fill
the resulting vector. Ignored if |
compressFun |
If specified, when compressing streams, instead of pasting
elements together using separator |
expandFun |
If specified, when expanding streams, instead of potentially
filling the new larger vector with elements (if |
compressFunPart |
A function to apply to the segments that are
automatically created; this can be passed instead of |
silent |
Whether to be silent or chatty. |
Value
The synced vector
Examples
rock::sync_vector(letters[1:10], 15);
rock::sync_vector(letters[1:10], 5);