Package: stringtools 0.02

stringtools: Tools for working with strings in R

Tools for working with strings in R

Authors:Sebastian Kranz

stringtools_0.02.tar.gz
stringtools_0.02.zip(r-4.5)stringtools_0.02.zip(r-4.4)stringtools_0.02.zip(r-4.3)
stringtools_0.02.tgz(r-4.4-any)stringtools_0.02.tgz(r-4.3-any)
stringtools_0.02.tar.gz(r-4.5-noble)stringtools_0.02.tar.gz(r-4.4-noble)
stringtools_0.02.tgz(r-4.4-emscripten)stringtools_0.02.tgz(r-4.3-emscripten)
stringtools.pdf |stringtools.html
stringtools/json (API)

# Install 'stringtools' in R:
install.packages('stringtools', repos = c('https://skranz.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/skranz/stringtools/issues

On CRAN:

3.66 score 2 stars 26 packages 29 scripts 49 exports 8 dependencies

Last updated 3 years agofrom:8a37e75f05 (on master). Checks:OK: 1 WARNING: 6. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 25 2024
R-4.5-winWARNINGOct 25 2024
R-4.5-linuxWARNINGOct 25 2024
R-4.4-winWARNINGOct 25 2024
R-4.4-macWARNINGOct 25 2024
R-4.3-winWARNINGOct 25 2024
R-4.3-macWARNINGOct 25 2024

Exports:char.matrix.to.strchar.vector.to.strcombine.pos.andcombine.pos.list.andcumsum.ignoreget.ignorehas.substrignore.and.complement.posignore.to.posmerge.linespos.complementpos.to.ignorepos.with.complementregexp.fixedsep.linesstr.at.posstr.betweenstr.blocks.posstr.detectstr.ends.withstr.extract.allstr.extract.firststr.findstr.inposstr.leftstr.left.ofstr.lenstr.list.to.regexp.orstr.locate.allstr.locate.at.endstr.locate.at.startstr.locate.firststr.matches.patternstr.remove.endsstr.remove.ignorestr.replacestr.replace.at.posstr.replace.by.blocksstr.replace.liststr.rightstr.right.ofstr.spacestr.splitstr.split.at.posstr.starts.withstr.tokenizestr.trimto.char.matrixto.char.vector

Dependencies:cligluelifecyclemagrittrrlangstringistringrvctrs

Readme and manuals

Help Manual

Help pageTopics
Helper functionadapt.blocks.after.replace
Helper functionadapt.pos.after.replace
Add level 0 to blocksblocks.add.level.0
converts a matrix of of single chars in a vector of one string per rowchar.matrix.to.str
converts a vector of chars into a single string or multiple strings, broken by sepchar.vector.to.str
Check if parameter to a str function have allowed dimensionscheck.str.par
Combine two positions via logical ANDcombine.pos.and
Combine a list of positions via logical ANDcombine.pos.list.and
Cummulative sum of number of characters that are ignoredcumsum.ignore
Gets a logical ignore vector or list from pos matricesget.ignore
Returns for every element of str whether there is a match with pattern works similar than greplhas.substr
Transforms a boolean vector ignore to a pos matrix and its complementignore.and.complement.pos
Transforms a boolean vector ignore to a pos matrixignore.to.pos
Combines c("A","B") into a single string seperated by line breaksmerge.lines
Returns the complement of a pos matrix again as a pos matrixpos.complement
Transforms a pos matrix into a logical ignore vector Warning length is notpos.to.ignore
Returns a pos matrix combined with its complement. The matrix has an attribute "complement" which is a logical vector indicating whether a row in the matrix is the original matrix or a complementpos.with.complement
strings will be treated as fixed constant in regexregexp.fixed
replaces German Umlaute with ascii letters oe, ue, aereplace.german.umlaute
transforms a single string with line breaks into a vector with one element for each linesep.lines
pos is a matrix or a list of matrices specifying positions as returned by str.locate.allstr.at.pos
Returns the between the first occurence of start and the first occurence of endstr.between
Returns a pos matrix indicating blocks like brackets ( ) or quoted parts "text"str.blocks.pos
Just a synonym for has.substrstr.detect
Returns als elements of txt that end with patternstr.ends.with
Returns a list that contains for each element of str (or pattern) a vector of all substrings that match the pattern. If for a string no element is matched an empty list is returnedstr.extract.all
Returns a vector that contains for each element of str (or pattern) the first substring that matches pattern or NA if no match could be foundstr.extract.first
Find substring positions or matchesstr.find
Returns a logical vector with TRUE for every character of str that is in posstr.inpos
keeps characters on leftstr.left
Returns the substring left to the first occurence of patternstr.left.of
a synonym for ncharstr.len
Transforms a vector of strings like c("A","B","C") into "A|B|C"str.list.to.regexp.or
Finds start and end positions of all substrings that match patternstr.locate.all
Locate a pattern at the end of strstr.locate.at.end
Locate a pattern at the start of stringsstr.locate.at.start
Finds start and end positions of first substring that matches patternstr.locate.first
Check if str completely matches a pattern (not just a substring)str.matches.pattern
Returns the number of matches of pattern in each element of strstr.number.matches
remove charcaters on left and right of a string str.remove.ends(c("ABCDEF","01"),1,3) returns c("BC","")str.remove.ends
ignore is a logical vector or matrix stating which char positions shall be ignored the function removes the substrings for which ignore=TRUEstr.remove.ignore
Replaces in str every occurence of pattern by replacementstr.replace
replace a string at the positions specified by posstr.replace.at.pos
Replaces in str every occurence of pattern by replacementstr.replace.by.blocks
Performs sequentially all replacements of pattern and replace on the same strings strstr.replace.list
keeps characters on rightstr.right
Returns the substring right to the first occurence of patternstr.right.of
Returns a string constisting of times spaces, vectorized over timesstr.space
Splits string vectorsstr.split
Splits a single string str at positions specified by posstr.split.at.pos
Returns als elements of txt that begin with patternstr.starts.with
An alternative interface to str.splitstr.tokenize
trims whitespaces from stringstr.trim
converts into a vector of strings into a matrix of single charactersto.char.matrix
converts a string into a vector of single charactersto.char.vector