[R] how to transform string to Camel Case?

2013-04-15 Thread Liviu Andronic
Dear all, Given the following vector: (z - c('R project', 'hello world', 'something Else')) [1] R project hello worldsomething Else I know how to obtain all capitals or all lower case letters: tolower(z) [1] r project hello worldsomething else toupper(z) [1] R PROJECT

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Pascal Oettli
Hi, There is an example of how to do do what you are looking for in ?toupper Regards, Pascal On 04/15/2013 03:50 PM, Liviu Andronic wrote: Dear all, Given the following vector: (z - c('R project', 'hello world', 'something Else')) [1] R project hello worldsomething Else I know how

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Henrik Bengtsson
See for instance capitalize() in the R.utils package. Henrik On Apr 14, 2013 11:51 PM, Liviu Andronic landronim...@gmail.com wrote: Dear all, Given the following vector: (z - c('R project', 'hello world', 'something Else')) [1] R project hello worldsomething Else I know how to

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread peter dalgaard
On Apr 15, 2013, at 08:50 , Liviu Andronic wrote: Dear all, Given the following vector: (z - c('R project', 'hello world', 'something Else')) [1] R project hello worldsomething Else I know how to obtain all capitals or all lower case letters: tolower(z) [1] r project hello

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Gergely Daróczi
Dear Liviu, I have just updated tocamel to have a new argument, so the development version of the package would produce: tocamel(z, upper = TRUE, sep = ' ') [1] R Project Hello WorldSomething Else Best, Gergely PS #1: to install the dev branch you might give a try to the devtools

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Liviu Andronic
On Mon, Apr 15, 2013 at 9:25 AM, Henrik Bengtsson h...@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.utils::capitalize(z) [1] R project Hello world

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Liviu Andronic
On Mon, Apr 15, 2013 at 9:20 AM, Pascal Oettli kri...@ymail.com wrote: There is an example of how to do do what you are looking for in ?toupper Unfortunately this fails when NA values are present: z - c(R project, hello world, something Else, NA) tocapwords(z) [1] R Project Hello World

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Liviu Andronic
On Mon, Apr 15, 2013 at 10:10 AM, Gergely Daróczi gerg...@snowl.net wrote: Dear Liviu, I have just updated tocamel to have a new argument, so the development version of the package would produce: tocamel(z, upper = TRUE, sep = ' ') [1] R Project Hello WorldSomething Else Thanks

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Rainer M. Krug
Liviu Andronic landronim...@gmail.com writes: On Mon, Apr 15, 2013 at 9:25 AM, Henrik Bengtsson h...@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)

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Gergely Daróczi
On 15 April 2013 14:10, Liviu Andronic landronim...@gmail.com wrote: On Mon, Apr 15, 2013 at 10:10 AM, Gergely Daróczi gerg...@snowl.net wrote: Dear Liviu, I have just updated tocamel to have a new argument, so the development version of the package would produce: tocamel(z, upper

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Liviu Andronic
On Mon, Apr 15, 2013 at 2:22 PM, Gergely Daróczi gerg...@snowl.net wrote: I have added an extra check in the function for NA values before applying `paste` at https://github.com/Rapporter/rapport/compare/34ca6a35fb...a04abc8b21 Alex might not like it :) Example: tocamel(z, upper = TRUE,

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread arun
-h...@stat.math.ethz.ch Cc: Sent: Monday, April 15, 2013 2:50 AM Subject: [R] how to transform string to Camel Case? Dear all, Given the following vector: (z - c('R project', 'hello world', 'something Else')) [1] R project      hello world    something Else I know how to obtain all capitals

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Gabor Grothendieck
On Mon, Apr 15, 2013 at 2:50 AM, Liviu Andronic landronim...@gmail.com wrote: Dear all, Given the following vector: (z - c('R project', 'hello world', 'something Else')) [1] R project hello worldsomething Else I know how to obtain all capitals or all lower case letters: tolower(z)

Re: [R] how to transform string to Camel Case?

2013-04-15 Thread Gabor Grothendieck
On Mon, Apr 15, 2013 at 10:56 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Mon, Apr 15, 2013 at 2:50 AM, Liviu Andronic landronim...@gmail.com wrote: Dear all, Given the following vector: (z - c('R project', 'hello world', 'something Else')) [1] R project hello world