Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

begins

Check Start of Character String


Description

Checks whether a character string begins with a particular prefix.

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.

Author(s)

and Ege Rubak rubak@math.aau.dk

Examples

begins(c("Hello", "Goodbye"), "Hell")
  begins("anything", "")

spatstat.linnet

Linear Networks Functionality of the 'spatstat' Family

v2.1-1
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Ottmar Cronie [ctb], Tilman Davies [ctb], Greg McSwiggan [ctb], Suman Rakshit [ctb]
Initial release
2021-03-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.