code_snip: Display a code snippet

View source: R/knitr-utils.R

code_snipR Documentation

Display a code snippet

Description

Pulls out a code snippet based on a start and end tags as comments within the code

Usage

code_snip(
  type,
  filename,
  startMatches = "START",
  endMatches = "END",
  includeStart = FALSE,
  includeEnd = FALSE,
  sep = "\n...\n"
)

Arguments

type

the code type

filename

the source code file

startMatches

a regex that matched start lines

endMatches

a regex that matches end lines

includeStart

is the regex inclusive of the start line or not

includeEnd

is the regex inclusive of the end line or not

sep

a seperator

Value

a text string of the selected code


terminological/ggrrr documentation built on June 15, 2024, 6:35 a.m.