[R] how to transform string to "Camel Case"?
landronimirc at gmail.com
Mon Apr 15 13:56:07 CEST 2013
On Mon, Apr 15, 2013 at 9:25 AM, Henrik Bengtsson <hb at biostat.ucsf.edu> wrote:
> See for instance capitalize() in the R.utils package.
Unfortunately this also fails when NA values are present:
z <- c("R project", "hello world", "something Else", NA)
 "R project" "Hello world" "Something Else" "NANA"
Any pointers how to work around that? Thanks,
> On Apr 14, 2013 11:51 PM, "Liviu Andronic" <landronimirc at gmail.com> wrote:
>> Dear all,
>> Given the following vector:
>> > (z <- c('R project', 'hello world', 'something Else'))
>>  "R project" "hello world" "something Else"
>> I know how to obtain all capitals or all lower case letters:
>> > tolower(z)
>>  "r project" "hello world" "something else"
>> > toupper(z)
>>  "R PROJECT" "HELLO WORLD" "SOMETHING ELSE"
>> I saw the tocamel() function in 'rapport', but it doesn't do what I
>> want to achieve as it actually proceeds to camelCase/CamelCase the
>> > tocamel(z)
>>  "RProject" "helloWorld" "somethingElse"
>> But how should I proceed to obtain Camel Case? Here's what I'd like to
>> c('R Project', 'Hello World', 'Something Else')
>> Do you know how to read?
>> Do you know how to write?
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
Do you know how to read?
Do you know how to write?
More information about the R-help