Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extrSpcText

Extract specific text


Description

extrSpcText extracts/cuts text-fragments out of 'txt' following specific anchors 'cutFrom' and 'cutTo'. In case 'cutFrom' not found 'missingAs' will be returned. In case 'cutTo' not found text gets extracted with 'chaMaxEl' characters.

Usage

extrSpcText(
  txt,
  cutFrom = " GN=",
  cutTo = " PE=",
  missingAs = NA,
  exclFromTag = TRUE,
  silent = 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

callFrom

(character) allow easier tracking of message(s) produced

Value

modified character vector

Examples

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

wrMisc

Analyze Experimental High-Throughput (Omics) Data

v1.5.4
GPL-3
Authors
Wolfgang Raffelsberger [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.