extrSpcText: Extract specific text

View source: R/extrSpcText.R

extrSpcTextR Documentation

Extract specific text

Description

This function extracts/cuts text-fragments out of txt following specific anchors defined by arguments cutFrom and cutTo.

Usage

extrSpcText(
  txt,
  cutFrom = " GN=",
  cutTo = " PE=",
  missingAs = NA,
  exclFromTag = TRUE,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Arguments

txt

character vector to be treated

cutFrom

(character) text where to start cutting

cutTo

(character) text where to stop cutting

missingAs

(character) specific content of output at line/location of 'exclLi'

exclFromTag

(logical) to exclude text given in 'cutFrom' from result

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

Details

In case cutFrom is not found missingAs will be returned. In case cutTo is not found, text gets extracted with chaMaxEl characters.

Value

This function returns a modified character vector

See Also

substr

Examples

extrSpcText(c(" ghjg GN=thisText PE=001"," GN=_ PE=", NA, "abcd"))
extrSpcText(c("ABCDEF.3-6","05g","bc.4-5"), cutFr="\\.", cutT="-")

wrMisc documentation built on Nov. 17, 2023, 5:09 p.m.