[R] How to change letters after space into capital letters

Martin Maechler maechler at stat.math.ethz.ch
Mon Apr 11 17:28:05 CEST 2005


>>>>> "Gabor" == Gabor Grothendieck <ggrothendieck at gmail.com>
>>>>>     on Mon, 11 Apr 2005 07:31:00 -0400 writes:

    Gabor> On Apr 11, 2005 6:22 AM, Wolfram Fischer <wolfram at fischer-zim.ch> wrote:
    >> What is the easiest way to change within vector of strings
    >> each letter after a space into a capital letter?
    >> 
    >> E.g.:
    >> c( "this is an element of the vector of strings", "second element" )
    >> becomes:
    >> c( "This Is An Element Of The Vector Of Strings", "Second Element" )
    >> 
    >> My reason to try to do this is to get more readable abbreviations.
    >> (A suggestion would be to add an option to abbreviate() which changes
    >> letters after space to uppercase letters before executing the abbreviation
    >> algorithm.)
    >> 

    Gabor> Look for the thread titled

    Gabor> String manipulation---mixed case

    Gabor> in the r-help archives.

Indeed!  Thank you, Gabor.

If you use R 2.1.0 beta  (which you should consider seriously as
a good netizen ;-),  this is as simple as

  > RSiteSearch("String manipulation---mixed case")
  A search query has been submitted to http://search.r-project.org
  The results page should open in your browser shortly

Martin.




More information about the R-help mailing list