On Wed, 18 Jun 2008, Tine wrote:

Hi!

Does anyone know hot to set number of digits to be printed in function 'paste'?

paste() does not print, so we can only guess at what you mean. The help says

     'paste' converts its arguments (_via_ 'as.character') to character
     strings, and concatenates them (separating them by the string
     given by 'sep').

So I guess you are talking about conversion by as.character. And its help says

    'as.character' represents real and complex numbers to 15
     significant digits (technically the compiler's setting of the ISO
     C constant 'DBL_DIG', which will be 15 on machines supporting
     IEC60559 arithmetic according to the C99 standard).  This ensures
     that all the digits in the result will be reliable (and not the
     result of representation error), but does mean that conversion to
     character and back to numeric may change the number.  If you want
     to convert numbers to character with the maximum possible
     precision, use 'format'.

and format() seems to be what you too are looking for (or sprintf or formatC).


Tine Mlač

______________________________________________
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.

PLEASE do at least read the help before posting, as the posting guides asks of you.

--
Brian D. Ripley,                  [EMAIL PROTECTED]
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
______________________________________________
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