every_nth | R Documentation |
Suppresses every n th element of a vector
every_nth(x, nth, empty = TRUE, inverse = FALSE)
x |
a vector (numbers, integers, characters, you name it) |
nth |
the multiple of position where the elements will be suppressed (nth + 1 actually) or kept (if inverse = T) |
empty |
whether the suppressed element should be replaced by "" |
inverse |
opposite reaction: n th elements only will be kept |
a vector with the remaining values
Adam D. Smith
practical usage of this function for axes: minorAxis
numvec <- 0:20
every_nth(numvec, 3)
every_nth(numvec, 3, empty = FALSE)
every_nth(numvec, 3, inverse = TRUE)
every_nth(numvec, 3, empty = FALSE, inverse = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.