begins

0th

Percentile

Check Start of Character String

Checks whether a character string begins with a particular prefix.

Keywords
character
Usage
begins(x, firstbit)
Arguments
x

Character string, or vector of character strings, to be tested.

firstbit

A single character string.

Details

This simple wrapper function checks whether (each entry in) x begins with the string firstbit, and returns a logical value or logical vector with one entry for each entry of x. This function is useful mainly for reducing complexity in model formulae.

Value

Logical vector of the same length as x.

Aliases
  • begins
Examples
# NOT RUN {
  begins(c("Hello", "Goodbye"), "Hell")
  begins("anything", "")
# }
Documentation reproduced from package spatstat, version 1.59-0, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.