Extract a text section with only non-comment lines from a character vector
Source:R/Functions-Txt.R
extractTextSection.RdFunction to extract a text section with only non-comment lines from a character vector.
Usage
extractTextSection(txt, n = length(txt), start = 1, comment = "#")Details
Each element in txt is regarded as a line of text (as in a text file).
The function searches for the first n non-comment lines and extracts them as a new vector.
The returned list has elements
txt - character vector of length
nwith comment lines removed (i.e., a subset oftxt)end - index of the last element extracted in the input
txtvector