| brk_manual | R Documentation |
breaks object manuallyCreate a breaks object manually
brk_manual(breaks, left_vec)
breaks |
A vector, which must be sorted. |
left_vec |
A logical vector, the same length as |
All breaks must be closed on exactly one side, like ..., x) [x, ...
(left-closed) or ..., x) [x, ... (right-closed).
For example, if breaks = 1:3 and left = c(TRUE, FALSE, TRUE), then the
resulting intervals are
T F T [ 1, 2 ] ( 2, 3 )
Singleton breaks are created by repeating a number in breaks. Singletons
must be closed on both sides, so if there is a repeated number
at indices i, i+1, left[i] must be TRUE and left[i+1] must be
FALSE.
A function which returns an object of class breaks.
lbrks <- brk_manual(1:3, rep(TRUE, 3))
chop(1:3, lbrks, extend = FALSE)
rbrks <- brk_manual(1:3, rep(FALSE, 3))
chop(1:3, rbrks, extend = FALSE)
brks_singleton <- brk_manual(
c(1, 2, 2, 3),
c(TRUE, TRUE, FALSE, TRUE))
chop(1:3, brks_singleton, extend = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.