[R] (no subject)

james.holtman@convergys.com james.holtman at convergys.com
Wed Feb 16 17:34:46 CET 2005





use 'gsub'

> x <- c('1,200.44', '23,345.66')
> gsub(',','',x)
[1] "1200.44"  "23345.66"
> as.numeric(gsub(',','',x))
[1]  1200.44 23345.66
>
__________________________________________________________
James Holtman        "What is the problem you are trying to solve?"
Executive Technical Consultant  --  Office of Technology, Convergys
james.holtman at convergys.com
+1 (513) 723-2929


                                                                                                                                           
                      Jim Gustafsson                                                                                                       
                      <jgu at codan.dk>               To:       r-help at stat.math.ethz.ch                                                      
                      Sent by:                     cc:                                                                                     
                      r-help-bounces at stat.m        Subject:  [R] (no subject)                                                              
                      ath.ethz.ch                                                                                                          
                                                                                                                                           
                                                                                                                                           
                      02/16/2005 09:08                                                                                                     
                                                                                                                                           





R-people

I wonder if one could change a list of table with number of the form
1,200.44 , to 1200.44

Regards
JG


------------------------------------------------------------------------------

This e-mail and any attachment may be confidential and may also be
privileged.
If you are not the intended recipient, please notify us immediately and
then
delete this e-mail and any attachment without retaining copies or
disclosing
the contents thereof to any other person.
Thank you.
------------------------------------------------------------------------------

             [[alternative HTML version deleted]]

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html




More information about the R-help mailing list