1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
\name{begins}
\alias{begins}
\title{
Check Start of Character String
}
\description{
Checks whether a character string begins with a particular prefix.
}
\usage{
begins(x, firstbit)
}
\arguments{
\item{x}{
Character string, or vector of character strings, to be tested.
}
\item{firstbit}{
A single character string.
}
}
\details{
This simple wrapper function checks whether (each entry in) \code{x}
begins with the string \code{firstbit}, and returns a logical value
or logical vector with one entry for each entry of \code{x}.
This function is useful mainly for reducing complexity in model formulae.
}
\value{
Logical vector of the same length as \code{x}.
}
\author{
\adrian
\rolf
and \ege
}
\examples{
begins(c("Hello", "Goodbye"), "Hell")
begins("anything", "")
}
\keyword{character}
|