R/trim.leading.R

#' Deleting leading white spaces
#'
#' Deleting leading white spaces from a \code{character} object.
#'
#' \code{tableTag} is an internal routine of \code{bibliometrics} package.
#'
#' @param x is a \code{character} object.

#' @return an object of class \code{character}
#' @examples
#'
#' char <- c("  Alfred", "Mary", " John")
#' char
#' trim.leading(char)
#' 
#' @export
trim.leading <- function (x){

sub("^\\s+", "", x)  ## function to delete leading spaces in a string
}

Try the bibliometrix package in your browser

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

bibliometrix documentation built on July 9, 2023, 6:44 p.m.