s-news
[Top] [All Lists]

Re: Coercing to character

To: asanquer@virbac.fr, s-news@wubios.wustl.edu
Subject: Re: Coercing to character
From: "Richard M. Heiberger" <rmh@temple.edu>
Date: Tue, 6 Sep 2005 08:54:51 -0400
> x <- c(3.45,3.40)
> format(x, nsmall=2)
[1] "3.45" "3.40"
> exportData(c(3.45, 3.40, .40), file="tmp.txt")
[1] 3
> exportData(c(3.45, 3.40, .40), file="tmp.txtf", type="FASCII", format="%5.2")
Warning messages:
  The 'colNames' argument of exportData() is ignored for this export file
        type. Column names will NOT be exported.
         in: openDataForWrite(file = file, type = type, keep = keep, drop =
        drop, filter =  ....
[1] 3
> 


exportData is designed for machine legibility.  The trailing 0 and the lead 0
are redundant.  Since you have a specific format of people legibility as your 
goal,
it is necessary to tell the program about your requirements.

Rich

<Prev in Thread] Current Thread [Next in Thread>