stringb: Convenient Base R String Handling

Base R already ships with string handling capabilities 'out- of-the-box' but lacks streamlined function names and workflow. The 'stringi' ('stringr') package on the other hand has well named functions, extensive Unicode support and allows for a streamlined workflow. On the other hand it adds dependencies and regular expression interpretation between base R functions and 'stringi' functions might differ. This packages aims at providing a solution to the use case of unwanted dependencies on the one hand but the need for streamlined text processing on the other. The packages' functions are solely based on wrapping base R functions into 'stringr'/'stringi' like function names. Along the way it adds one or two extra functions and last but not least provides all functions as generics, therefore allowing for adding methods for other text structures besides plain character vectors.

AuthorPeter Meissner [aut, cre]
Date of publication2016-11-01 15:18:21
MaintainerPeter Meissner <>
LicenseMIT + file LICENSE

View on CRAN

Man pages a stringsAsFactors=FALSE

cuts_to_spans: helper function that turns cut points into spans

data.frame: a stringsAsFactors=FALSE data.frame

de_sequenize: helper function to transforms sequences into spans

drop_non_group_matches: helper for usage of regmatches

dummy_func: imports

get_groups: helper function for text_extract_group

grapes-.-grapes: concatenating strings operator

grapes-..-grapes: concatenating strings

invert_spans: function to invert spans to those numbers not covered

plot.character: function for plotting text

regmatches2: helper function to standardize regexpr results

sequenize: helper function to spans into sequences

stringb_arrange: function to sort df by variables

test_file: text function: wrapper for system.file() to access test files

text_c: generic for concatenating strings

text_collapse: function for collapsing text vectors

text_count: generic for counting pattern occurences

text_delete: deleting patterns in string

text_detect: generic function to test if a regex can be found within a...

text_eval: wrapper function of eval() and parse() to evaluate character...

text_extract: extract regex matches

text_extract_all: extract regex matches

text_extract_group: generic for getting regex group matches

text_extract_group_all: generic for getting all regex group matches

text_filter: generic for subsetting/filtering vectors

text_length: wrapper around nchar to return text length

text_locate: function to get start, end, length form pattern match

text_locate_all: function to get start, end, length form pattern match for all...

text_locate_all_worker: helper function to get start, end, length form pattern match

text_locate_group: generic for getting positions regex groups

text_locate_worker: helper function to get start, end, length form pattern match

text_nchar: wrapper around nchar to return text length

text_pad: padding text to specified width

text_read: read in text

text_rep: generic repeating text

text_replace: replacing patterns in string

text_replace_all: replacing patterns in string

text_replace_group: function for replacing regex group matches generic for...

text_replace_locates: text_replace_locates default

text_show: showing text

text_snippet: retrieving text snippet

text_split: generic splitting strings

text_split_n: generic splitting strings into pieces of length n

text_sub: generic for extracting characters sequences by position

text_subset: generic for subsetting/filtering vectors

text_tokenize: generic for gregexpr wrappers to tokenize text

text_tokenize_lines: generic to tokenize text into lines

text_tokenize_sentences: generic to tokenize text into sentences

text_tokenize_words: generic to tokenize text into words

text_to_lower: function for make text lower case

text_to_title_case: function for make text lower case

text_to_upper: function for make text lower case

text_trim: trim spaces

text_which: generic function to know in which elements a pattern can be...

text_which_value: generic function to get whole elements in which pattern was...

text_wrap: wraping text to specified width

text_write: write text to file


\%..\% Man page
\%.\% Man page Man page
cuts_to_spans Man page
data.frame Man page
de_sequenize Man page
drop_non_group_matches Man page
dummy_func Man page
get_groups Man page
invert_spans Man page
plot.character Man page
regmatches2 Man page
sequenize Man page
stringb_arrange Man page
test_file Man page
text_c Man page
text_c.default Man page
text_collapse Man page Man page
text_collapse.default Man page
text_collapse.list Man page
text_collapse.matrix Man page
text_count Man page
text_count.default Man page
text_delete Man page
text_delete.default Man page
text_detect Man page
text_detect.default Man page
text_dup Man page
text_eval Man page
text_extract Man page
text_extract_all Man page
text_extract_group Man page
text_extract_group_all Man page
text_extract_group_all.default Man page
text_extract_group.default Man page
text_filter Man page
text_grep Man page
text_grepl Man page
text_grepv Man page
text_length Man page
text_locate Man page
text_locate_all Man page
text_locate_all.default Man page
text_locate_all_worker Man page
text_locate.default Man page
text_locate_group Man page
text_locate_group.default Man page
text_locate_worker Man page
text_nchar Man page
text_pad Man page
text_pad.default Man page
text_read Man page
text_rep Man page
text_rep.default Man page
text_replace Man page
text_replace_all Man page
text_replace_all.default Man page
text_replace.default Man page
text_replace_group Man page
text_replace_group.default Man page
text_replace_locates Man page
text_replace_locates.default Man page
text_show Man page
text_show.default Man page
text_snippet Man page
text_split Man page
text_split.default Man page
text_split_n Man page
text_split_n.default Man page
text_sub Man page
text_sub.default Man page
text_subset Man page
text_tokenize Man page
text_tokenize.default Man page
text_tokenize_lines Man page
text_tokenize_lines.default Man page
text_tokenize_sentences Man page
text_tokenize_sentences.default Man page
text_tokenize_words Man page
text_tokenize_words.default Man page
text_to_lower Man page
text_to_lower.default Man page
text_to_title_case Man page
text_to_title_case.default Man page
text_to_upper Man page
text_to_upper.default Man page
text_trim Man page
text_trim.default Man page
text_trim.list Man page
text_trim.numeric Man page
text_which Man page
text_which.default Man page
text_which_value Man page
text_which_value.default Man page
text_wrap Man page
text_wrap.default Man page
text_write Man page
text_write.default Man page


stringb/R/text_replace_group.R stringb/R/text_show.R stringb/R/text_extract_group.R stringb/R/text_sub.R stringb/R/text_locate_group.R stringb/R/text_collapse.R stringb/R/text_locate.R stringb/R/text_length.R stringb/R/text_extract_all.R stringb/R/text_split.R stringb/R/text_which.R stringb/R/text_to_lower.R stringb/R/text_detect.R stringb/R/text_extract.R stringb/R/text_pad.R
stringb/R/text_write.R stringb/R/text_count.R stringb/R/tools.R stringb/R/text_dup.R stringb/R/text_c.R stringb/R/text_replace.R stringb/R/text_eval.R stringb/R/character_plot.R stringb/R/text_read.R stringb/R/text_tokenize.R stringb/R/text_trim.R stringb/R/text_wrap.R stringb/R/text_snippet.R stringb/R/zzz.R
stringb/man/text_locate_all.Rd stringb/man/text_pad.Rd stringb/man/test_file.Rd stringb/man/text_sub.Rd stringb/man/text_snippet.Rd stringb/man/invert_spans.Rd stringb/man/text_split_n.Rd stringb/man/data.frame.Rd stringb/man/text_count.Rd stringb/man/ stringb/man/cuts_to_spans.Rd stringb/man/text_locate_all_worker.Rd stringb/man/text_tokenize_words.Rd stringb/man/text_replace_all.Rd stringb/man/regmatches2.Rd stringb/man/text_to_title_case.Rd stringb/man/text_length.Rd stringb/man/text_detect.Rd stringb/man/text_wrap.Rd stringb/man/text_write.Rd stringb/man/text_replace.Rd stringb/man/text_tokenize_lines.Rd stringb/man/text_replace_locates.Rd stringb/man/sequenize.Rd stringb/man/text_extract_all.Rd stringb/man/text_locate_group.Rd stringb/man/text_tokenize_sentences.Rd stringb/man/dummy_func.Rd stringb/man/drop_non_group_matches.Rd stringb/man/text_extract_group_all.Rd stringb/man/get_groups.Rd stringb/man/text_locate_worker.Rd stringb/man/text_tokenize.Rd stringb/man/text_show.Rd stringb/man/text_which.Rd stringb/man/text_extract.Rd stringb/man/text_nchar.Rd stringb/man/grapes-..-grapes.Rd stringb/man/text_extract_group.Rd stringb/man/text_delete.Rd stringb/man/text_which_value.Rd stringb/man/text_rep.Rd stringb/man/text_eval.Rd stringb/man/text_to_lower.Rd stringb/man/text_trim.Rd stringb/man/text_replace_group.Rd stringb/man/grapes-.-grapes.Rd stringb/man/plot.character.Rd stringb/man/text_c.Rd stringb/man/text_filter.Rd stringb/man/text_split.Rd stringb/man/text_subset.Rd stringb/man/de_sequenize.Rd stringb/man/stringb_arrange.Rd stringb/man/text_locate.Rd stringb/man/text_read.Rd stringb/man/text_collapse.Rd stringb/man/text_to_upper.Rd

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.