Learn R Programming

⚠️There's a newer version (0.7) of this package.Take me there.

gsubfn (version 0.3-1)

Utilities for strings and function arguments.

Description

gsubfn is like gsub but can take a replacement function or proto object rather than a replacement string. Matches and back references are input to the function and replaced by the function output. In the case of a proto object the object is used for sharing information from one match to the next. gsubfn can be used to split strings based on content rather than delimiters and for quasi-perl-style string interpolation. The package also has facilities for translating formulas to functions and allowing such formulas in function calls instead of functions. This can reduce code size and improve clarity when using apply, lapply, optim, integrate, xyplot and any other function that expects another function as an input argument.

Copy Link

Version

Install

install.packages('gsubfn')

Monthly Downloads

20,676

Version

0.3-1

License

GPL (Version 2 or later)

Maintainer

G. Grothendieck

Last Published

April 12th, 2018

Functions in gsubfn (0.3-1)

as.function.formula

Make a one-line function from a formula.
gsubfn

Pattern Matching and Replacement
gsubfn-package

gsubfn
match.funfn

Generic extended version of R match.fun
strapply

Apply a function over a string or strings.
cati

cat with string interpolation
fn

Transform formula arguments to functions.