Description Usage Arguments Details Value Author(s) See Also Examples
Determine if a character string "starts with" with the specified characters.
1 |
str |
character vector to test |
pattern |
characters to check for |
trim |
Logical flag indicating whether leading whitespace should
be removed from |
ignore.case |
Logical flag indicating whether case should be ignored when testing for a match. |
This function returns TRUE for each element of the vector str
where pattern
occurs at the beginning of the string. If
trim
is TRUE, leading whitespace is removed from the elements
of str
before the test is performed. If ignore.case
is
TRUE, character case is ignored.
Boolean vector of the same length as str
.
Gregory R. Warnes greg@warnes.net
1 2 3 4 5 6 7 8 9 10 | ## simplest example:
startsWith( 'Testing', 'Test')
## vector examples
s <- c('Testing', ' Testing', 'testing', 'Texting')
names(s) <- s
startsWith(s, 'Test') # ' Testing', 'testing', and 'Texting' do not match
startsWith(s, 'Test', trim=TRUE) # Now ' Testing' matches
startsWith(s, 'Test', ignore.case=TRUE) # Now 'testing' matches
|
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to locate valid perl interpreter
gdata:
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata:
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.
gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.
Attaching package: 'gdata'
The following object is masked from 'package:stats':
nobs
The following object is masked from 'package:utils':
object.size
The following object is masked from 'package:base':
startsWith
[1] TRUE
[1] TRUE FALSE FALSE FALSE
[1] TRUE TRUE FALSE FALSE
[1] TRUE FALSE TRUE FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.