R/left.R

Defines functions left

Documented in left

#' Extract the \code{n} characters from the left of a string
#' \code{left} uses a specific case of the \code{substr} function to take only
#'   the left most \code{n} characters from the input string.
#' @param x a string
#' @param n the number of characters from the left of the string to extract
#' @examples
#' foo <- "foo"
#' left(foo, 2)
#' @export
left <- function(x, n) {
  substr(x, 1, n)
}
mike-decarlo/augmentR documentation built on March 17, 2023, 11:05 a.m.