On Fri, Sep 18, 2009 at 12:59:16PM +0200, Philipp Pagel wrote:

> > foo$B <- as.numeric(sub(',', '', as.character(foo$B)))

Thinking about it some more, you should use gsub instead of sub here.
Otherwise only the first occurrence of the thousands separator will be
removed.

cu
        Philipp


-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to