R/p_gsub.r

Defines functions p_gsub

Documented in p_gsub

#' Replaces regular expressions
#' 
#' A wrapper function for `gsub()`, with the `x` argument listed first to support native piping.
#'
#' @param x the character string
#' @param ... additional arguments passed to [gsub()].
#'
#' @returns a logical object 
#' @export
#'
#' @examples
#' c('dog','elephant','cat','horse','hippopotamus') |> p_gsub('^h','H')
p_gsub<-function(x,...) {
  gsub(x=x,...)
}

Try the baseverse package in your browser

Any scripts or data that you put into this service are public.

baseverse documentation built on Oct. 27, 2026, 1:07 a.m.