Learn R Programming

stringb (version 0.1.17)

text_replace_locates: text_replace_locates default

Description

text_replace_locates default

text_replace_locates default

Usage

text_replace_locates(string, found, replacement, group, invert)

# S3 method for default text_replace_locates(string, found, replacement, group, invert)

Arguments

string

text for which to replace parts

found

result of an call to text_locate_group or text_locate - i.e. a list of data.frames with two columns named 'start' and 'end' that mark character spans to be replaced within the text elements

replacement

character vector of replacements of length 1 or length(group) to replace regex group matches (marked character spans provided by the found parameter)

group

vector of integers identifying thos regex groups to be replaced

invert

should character spans provided by found or their counterparts be replaced