[6360] in s-news-athena

home help back first fref pref prev next nref lref last post

bug[let] in format.default(.) [Splus 3.2]

daemon@ATHENA.MIT.EDU (Martin Maechler)
Thu Feb 2 04:37:59 1995

From: Martin Maechler <maechler@stat.math.ethz.ch>
Date: Thu, 2 Feb 1995 10:20:48 +0100
To: s-news@utstat.toronto.edu
Cc: support@statsci.com
Reply-To: Martin Maechler <maechler@stat.math.ethz.ch>


You may have noticed the  humongous amount of possibilities available
with the new  format(.)  function  in  S-plus 3.2.
The new flexibility is great,  
	[maybe even as big es becoming confusing to the average user...]

The following shows problem(s) of  format.default(.)
which should more carefully check things 
	(incompatibilities of arguments):

### (The following is 'sourceable' into S) :

find(format)
## [1] "/usr/local/splus3.2/splus/.Functions"

format(x, dig=3, nsmall=2)
## [1] "   0.00  " "   0.03  " "   0.31  " "   3.14  " "  31.40  " " 314.00  "
## [7] "3140.00  " "   3.14e4" "   3.14e5"

##--- Here comes  THE BUG: ----
format(x, dig=3, nsmall=3)
# Error in rep.int: No missing values allowed in "times": rep.int(1:xlen, times)
# Dumped

## Yes, it may well be true that  'nsmall=3' does not make sense with 'dig=3',
##	IN THIS CASE,  but the following is ok :

format(x[1:7], dig=3, nsmall=3)
##[1] "   0.003" "   0.031" "   0.314" "   3.140" "  31.400" " 314.000" "3140.000"

home help back first fref pref prev next nref lref last post