R/Paste.R

#' Paste grapes
#'
#' Paste0 strings together with grapes (inverse/inside out function call)
#'
#' @param lhs Left hand side presumably character string
#' @param rhs Right hand side presumably another character string
#' @return A pasted together (with no space) string(s)
#' @export
'%P%' <- function(lhs, rhs) {
  UseMethod("%P%")
}

#' @export
'%P%.default' <- function(lhs, rhs) {
  if (is.recursive(lhs) || is.recursive(rhs)) {
    stop("`%P%` expected atomic but got recursive.", call. = FALSE)
  }
  paste0(lhs, rhs)
}

Try the tfse package in your browser

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

tfse documentation built on May 2, 2019, 11:28 a.m.