camelParse: Split a character string where a capital letter follows a...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/camelParse.R

Description

Split a character string where a capital letter follows a lowercase letter.

Usage

1
camelParse(x, except=c('De', 'Mc', 'Mac'))

Arguments

x

a character vector

except

character vector giving exceptions: If any of these are found, ignore and look for the next one

Details

Find all places where a lowercase letter is followed by a capital.

Split on those points

Value

list of character vectors

Author(s)

Spencer Graves

See Also

strsplit

Examples

1
2
3
4
5
6
7
8
9
tst <- c('Smith, JohnJohn Smith',
         'EducationNational DefenseOther Committee',
         'McCain, JohnJohn McCain')
tst. <- camelParse(tst)


all.equal(tst., list(c('Smith, John', 'John Smith'),
    c('Education', 'National Defense', 'Other Committee'),
    c('McCain, John', 'John McCain') ) )

Ecfun documentation built on May 2, 2019, 6:53 p.m.