Learn R Programming

stringb (version 0.1.17)

Convenient Base R String Handling

Description

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.

Copy Link

Version

Install

install.packages('stringb')

Monthly Downloads

22

Version

0.1.17

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Peter Meissner

Last Published

January 25th, 2021

Functions in stringb (0.1.17)

invert_spans

function to invert spans to those numbers not covered
%.%

concatenating strings operator
de_sequenize

helper function to transforms sequences into spans
%..%

concatenating strings
as.data.frame

a stringsAsFactors=FALSE as.data.frame
data.frame

a stringsAsFactors=FALSE data.frame
drop_non_group_matches

helper for usage of regmatches
dummy_func

imports
get_groups

helper function for text_extract_group
text_collapse

function for collapsing text vectors
sequenize

helper function to spans into sequences
text_delete

deleting patterns in string
text_detect

generic function to test if a regex can be found within a string
text_length

wrapper around nchar to return text length
stringb_arrange

function to sort df by variables
text_extract_group

generic for getting regex group matches
plot.character

function for plotting text
regmatches2

helper function to standardize regexpr results
text_extract_all

extract regex matches
text_eval

wrapper function of eval() and parse() to evaluate character vector
cuts_to_spans

helper function that turns cut points into spans
text_read

read in text
text_extract

extract regex matches
text_rep

generic repeating text
text_locate

function to get start, end, length form pattern match
test_file

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

function for make text lower case
text_tokenize

generic for gregexpr wrappers to tokenize text
text_wrap

wraping text to specified width
text_replace_group

function for replacing regex group matches generic for getting regex group matches
text_replace_locates

text_replace_locates default
text_count

generic for counting pattern occurences
text_to_title_case

function for make text lower case
text_to_lower

function for make text lower case
text_extract_group_all

generic for getting all regex group matches
text_replace

replacing patterns in string
text_write

write text to file
text_sub

generic for extracting characters sequences by position
text_subset

generic for subsetting/filtering vectors
text_replace_all

replacing patterns in string
text_c

generic for concatonating strings
text_locate_all

function to get start, end, length form pattern match for all matches
text_filter

generic for subsetting/filtering vectors
text_nchar

wrapper around nchar to return text length
text_pad

padding text to specified width
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_split

generic splitting strings
text_which

generic function to know in which elements a pattern can be found
text_which_value

generic function to get whole elements in which pattern was found
text_show

showing text
text_tokenize_words

generic to tokenize text into words
text_split_n

generic splitting strings into pieces of length n
text_trim

trim spaces
text_snippet

retrieving text snippet
text_tokenize_lines

generic to tokenize text into lines
text_tokenize_sentences

generic to tokenize text into sentences