R/syncing_df_expand.R
, R/syncing_vector_expand.R
expanding_vectors_or_dataframes.Rd
Expand a vector or data frame
The vector or data frame
The new length (or number of rows for a data frame)
When expanding streams, whether to duplicate elements to fill
the resulting vector. Ignored if fillFun
is specified.
If specified, when expanding streams, instead of potentially
filling the new larger vector with elements (if fill
is TRUE
), the
vectors are passed to function expandFun
, which must accept a vector (to
compress) and a single integer (with the desired resulting length of
the vector).
Whether to be silent or chatty.
The expanded vector
rock::syncing_vector_expand(letters[1:10], 15);
#> [1] "a" "b" "b" "c" "d" "d" "e" "f" "f" "g" "h" "h" "i" "j" "j"
rock::syncing_vector_expand(letters[1:10], 15, fill=FALSE);
#> [1] "a" "b" "" "c" "d" "" "e" "f" "" "g" "h" "" "i" "j" ""