camelParse | R Documentation |
Split a character string where a capital letter follows a lowercase letter.
camelParse(x, except=c('De', 'Mc', 'Mac'))
x |
a character vector |
except |
character vector giving exceptions: If any of these are found, ignore and look for the next one |
Find all places where a lowercase letter is followed by a capital.
Split on those points
list of character vectors
Spencer Graves
strsplit
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') ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.