rep_along | R Documentation |
These functions take the idea of seq_along()
and apply it to
repeating values.
rep_along(along, x)
rep_named(names, x)
along |
Vector whose length determine how many times |
x |
Values to repeat. |
names |
Names for the new vector. The length of |
new-vector
x <- 0:5
rep_along(x, 1:2)
rep_along(x, 1)
# Create fresh vectors by repeating missing values:
rep_along(x, na_int)
rep_along(x, na_chr)
# rep_named() repeats a value along a names vectors
rep_named(c("foo", "bar"), list(letters))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.