lichi@physics.uoguelph.ca
2004-Aug-24 15:31 UTC
[R] how to set the number format to pure numeric?
Hello, I want to export a numeric matrix in pure numeric format, i.e. I want 0.0001 to appear as "0.0001". But it seems the default setting for write.table is scientific notation, i.e. it will appear as "1e-04". how to set the number format to pure numeric? Thank you very much for your help. cheers, lichi shi
On Tue, 24 Aug 2004 lichi at physics.uoguelph.ca wrote:> I want to export a numeric matrix in pure numeric format, i.e. I want > 0.0001 to appear as "0.0001". But it seems the default setting for > write.table is scientific notation, i.e. it will appear as "1e-04". how to > set the number format to pure numeric? Thank you very much for your help.It's not the default, BTW. Try 0.002, say. See ?options and look at `scipen' to alter the rules. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
lichi shi <lichi at physics.uoguelph.ca> wrote:> I want to export a numeric matrix in pure numeric format, i.e. I want > 0.0001 to appear as "0.0001". But it seems the default setting for > write.table is scientific notation, i.e. it will appear as "1e-04". how > to set the number format to pure numeric?Try: R> options(scipen=99) which sets a very high SCIentific notation PENalty. -- -- David Brahm (brahm at alum.mit.edu)