View source: R/post-process-extract-chunks.R
post_process_extract_chunks | R Documentation |
Extract chunks of lines from a vector of lines
post_process_extract_chunks(x, beg_inds, end_inds)
x |
Tex code, as a vector of lines read in from a TeX file by |
beg_inds |
A vector of beginning indices for the chunks to
extract. Must be the same length as |
end_inds |
A vector of ending indices for the chunks to
extract. Must be the same length as |
Creates two lists of slices of the input vector, the first list will
contain the slices between beg_inds
and end_inds
. The second
list will contain the slices NOT between beg_inds
and end_inds
.
If the first element of beg_ind
is 1, then the return flag first
will
be set to TRUE
. If the first element of beg_ind
is not a 1, the
return flag first
will be set to FALSE
. If the difference between
an end_inds
value and the corresponding next beg_inds
value, a
line with an empty string will be placed between them so that the
interlacing between the two lists remains perfect, so they 'zipper'
together 1 after the other.
A list of three elements, the first being the list of vectors
which are 'in-between' the beg_inds
and end_inds
values. The second
is a list of vectors which are 'between' the beg_inds
and end_inds
values. the third is first
which is explained above in @details
library(hake)
k <- extract_chunks(letters, c(2, 10), c(9, 12))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.