View source: R/get_lines_between_tags.R
get_lines_between_tags | R Documentation |
Get all lines between tagged lines. The tagged lines themselves may be in- or excluded from the selection.
get_lines_between_tags(
file_name,
keep_tagged_lines = TRUE,
begin_pattern = "ROXYGEN_START",
end_pattern = "ROXYGEN_STOP",
from_first_line = TRUE,
to_last_line = TRUE
)
file_name |
The name of the R code file to be parsed. |
keep_tagged_lines |
Keep tagged lines output? |
begin_pattern |
A pattern that marks the line beginning a roxygen2 chunk. |
end_pattern |
A pattern that marks the line ending a roxygen2 chunk. |
from_first_line |
Use first line as tagged line if first tag found
matches the |
to_last_line |
Use last line as tagged line if last tag found matches
the |
A character vector of matching lines.
If you know the file to contain valid roxygen2 code only, you do not need to tag any lines if you keep from_first_line and to_last_line both TRUE: in this case the whole file will be returned.
Other file utilities:
clipboard_path()
,
delete_trailing_blank_lines()
,
delete_trailing_whitespace()
,
develop_test()
,
file_copy()
,
file_modified_last()
,
file_save()
,
find_files()
,
get_mtime()
,
get_unique_string()
,
grep_file()
,
is_files_current()
,
is_path()
,
paths
,
search_files()
,
split_code_file()
,
touch()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.