Package: stringmagic 1.2.0

stringmagic: Character String Operations and Interpolation, Magic Edition

Performs complex string operations compactly and efficiently. Supports string interpolation jointly with over 50 string operations. Also enhances regular string functions (like grep() and co). See an introduction at <https://lrberge.github.io/stringmagic/>.

Authors:Laurent R Berge [aut, cre], Morgan Jacob [ctb]

stringmagic_1.2.0.tar.gz
stringmagic_1.2.0.zip(r-4.7)stringmagic_1.2.0.zip(r-4.6)stringmagic_1.2.0.zip(r-4.5)
stringmagic_1.2.0.tgz(r-4.6-x86_64)stringmagic_1.2.0.tgz(r-4.6-arm64)stringmagic_1.2.0.tgz(r-4.5-x86_64)stringmagic_1.2.0.tgz(r-4.5-arm64)
stringmagic_1.2.0.tar.gz(r-4.7-arm64)stringmagic_1.2.0.tar.gz(r-4.7-x86_64)stringmagic_1.2.0.tar.gz(r-4.6-arm64)stringmagic_1.2.0.tar.gz(r-4.6-x86_64)
stringmagic_1.2.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
stringmagic/json (API)

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

Bug tracker:https://github.com/lrberge/stringmagic/issues

Pkgdown/docs site:https://lrberge.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

interpolationstringcpp

10.34 score 17 stars 44 packages 65 scripts 43k downloads 45 exports 1 dependencies

Last updated from:87b187d40c. Checks:13 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK169
linux-devel-x86_64OK138
source / vignettesOK196
linux-release-arm64OK156
linux-release-x86_64OK176
macos-release-arm64OK104
macos-release-x86_64OK237
macos-oldrel-arm64OK92
macos-oldrel-x86_64OK203
windows-develOK133
windows-releaseOK116
windows-oldrelOK113
wasm-releaseOK154

Exports:.string_magiccat_magiccat_magic_aliascatmaget_interpolated_exprget_interpolated_varsmemamessage_magicmessage_magic_aliasparse_regex_patternpaste_conditionalsmastallstanystcleanstextractstgetstisstopsstreplacestring_allstring_anystring_cleanstring_clean_aliasstring_extractstring_fillstring_getstring_isstring_magicstring_magic_aliasstring_magic_register_funstring_magic_register_opsstring_opsstring_ops_aliasstring_replacestring_splitstring_split2dfstring_split2dtstring_vecstring_vec_aliasstring_whichstsplitstvecstwhichtimer_magic

Dependencies:Rcpp

string_magic's operations: The reference
Basic string operations | s, S, split, Split: Split strings | c, C, collapse, Collapse: Collapse strings | extract, x, X: Extract patterns | r, R, replace: Replace patterns | clean: Clean string patterns | get: Get selected strings | is: Detect patterns in strings | which: Get the index of the strings containing a pattern | Operations changing the length or the order | first: Keep only the first elements | K: Keep only the first elements (alternative) | last: Keep only the last elements | sort: Sort the vector | dsort: Sort the vector in decreasing order | rev: Reverse the vector | unik: Keep only unique elements | table: Attach unique elements to their frequencies | each: Repeat each elements of the vector | times: Repeats the vector | rm: Remove specific values | nuke: Remove all value | insert: Insert a character string | dp, deparse: Deparse an object | Formatting operations | lower: Change the case | upper: Change the case | title: Change the case | ws: Normalize white spaces | tws: Trim white spaces | q, Q, bq: Add various type of quotes | format, Format: Format the values with base::format | %: Apply sprintf formatting | stopwords: Remove stop words | ascii: Turn the string to ASCII | round, signif, r0-r6, s0-s6: Formatting numbers | n, N: Formatting integers | nth, Nth: Numbered position | ntimes, Ntimes: Number of times | firstchar, lastchar: Keep only the first, last characters | k, shorten, Shorten: Shortens character strings | fill, align, width: Fill character strings | paste, append: Append text | join: Join lines | escape: Escape special characters | Other operations | num: Convert to numeric | enum: Create an enumeration | len, Len: Formatted length | swidth: Add newlines to force the string to fit a given width | difftime: Formatted time difference

Last update: 2024-08-26
Started: 2023-06-30

Regular expression flags
Regex flags: Syntax | Regex flags: Reference | ignore | fixed | word | magic | total | single | Escaping flags: How to, and a word of caution with paths

Last update: 2024-05-02
Started: 2023-06-30

String tools: magic edition
Detection of regex patterns | Pattern detection with string_is, string_which and string_get | Specificities of srt_get | Sequentially appending results | Caching | Chaining string operations with string_ops | string_clean: One function to clean them all | Cleaning syntax | Example of text cleaning | Create simple character vectors with string_vec | Creating small matrices or data frames | Split vectors and turn the result into a data frame, and vice versa

Last update: 2024-05-02
Started: 2023-06-30

Tailor-made functions and operations
Creating new functions with alias generators | Creating a formula builder | Changing str_clean | Creating small numeric matrices | Creating your own string operations | New operations as a sequence of existing operations | New operations using a custom function | Using stringmagic with custom operations as a dependency | Why do I need a namespace? | Using custom operations in a package | Example | Using aliases

Last update: 2023-08-30
Started: 2023-06-30

string_magic's sepcial operations
Group-wise operations | Conditional operations | if statement | Verbatim if statement | Special interpolation: if-else | Regular if-else: "&" | if-else with automatic filling | Special interpolation: Pluralization | Pluralization: Principles | Pluralization: Regular operations | s, es | y or ies | enum | n, N, len, Len | nth, ntimes | is, or any verb | Pluralization: Conditional statements | Direct access to the current time and a timer facility | Current date and time | Timer

Last update: 2023-08-23
Started: 2023-07-18

string_magic: Magical String Interpolation
Basic interpolation | How to add operations to interpolations | Adding arguments to operations | Alternative ways to pass arguments | Adding options to operations | Nesting interpolations | Pluralization: A brief introduction | Escaping and special cases | Escape brackets | Other escapes | How to use a regular ! in interpolations?

Last update: 2023-07-21
Started: 2023-07-18

Regular expression logic
Logically combining regex patterns | Escaping the meaning of the logical operators | How do regex flags work with logically combined regexes?

Last update: 2023-07-19
Started: 2023-06-30

Readme and manuals

Help Manual

Help pageTopics
Display messages using interpolated stringscatma cat_magic cat_magic_alias mema message_magic message_magic_alias
Lists the expressions used for interpolation in a 'string_magic' callget_interpolated_expr get_interpolated_vars
'stringmagic''s regular expression parserparse_regex_pattern
Paste a string vector conditionallypaste_conditional
Cleans a character vector from multiple patternsstclean streplace string_clean string_clean_alias string_replace
Extracts a pattern from a character vectorstextract string_extract
Fills a character string up to a sizestring_fill
Gets elements of a character vectorstget string_get
Detects whether a pattern is in a character stringstall stany stis string_all string_any string_is string_which stwhich
String interpolation with operation chaining.string_magic sma string_magic
Create 'string_magic' aliases with custom defaultsstring_magic_alias
Register custom operations to apply them in 'string_magic'string_magic_register_fun string_magic_register_ops
Chains basic operations to character vectorsstops string_ops string_ops_alias
Splits a character string wrt a patternstring_split stsplit
Splits a character vector into a data framestring_split2df string_split2dt
Efficient creation of string vectors with optional interpolationstring_vec string_vec_alias stvec
Sets up a timer that can be used within _magic functionstimer_magic