s-news
[Top] [All Lists]

Re: print(quote=F) bug in S+ 6.0.3?

To: "Buttrey, Samuel" <sebuttre@nps.navy.mil>
Subject: Re: print(quote=F) bug in S+ 6.0.3?
From: Sundar Dorai-Raj <sundar.dorai-raj@pdf.com>
Date: Fri, 23 Aug 2002 12:14:12 -0500
Cc: S-News <s-news@lists.biostat.wustl.edu>
Organization: PDF Solutions, Inc.
References: <6D6E69A9D017DD488D2AB199B9C3564C092555@essex.ad.nps.navy.mil>
Sam,

"Buttrey, Samuel" wrote:
> 
> Hi. I've found what I think to be a bug in the behavior of print() which 
> shows up on a list that includes a data.frame in S+ 6.0.3 release 2 for 
> Windows.
> 
> > print (list (a = 1:3))
> $a:
> [1] 1 2 3 # Works well
> 
> > print (list (a = data.frame (1:3)))
> $a:
>    X1
> 1 "1"
> 2 "2"
> 3 "3" # not so good
> 
> Notice the quotes, which do not appear using the same command in S-Plus 2000.
> 
> I believe the "problem" lies in the fact that the result of format() on a 
> data.frame carries class "matrix" in S+ 6.0. print.matrix() doesn't do what 
> you would expect here.
> 

This is a known bug by Insightful for 6.0. It was fixed in 6.1.


> Consider this:
> 
> > print (matrix ("1"), prefix = "a", quote=T)
>      [,1]
> [1,] "1"
> > print (matrix ("1"), prefix = "a", quote=F)  # should have no quote
>      [,1]
> [1,] "1"
> 
> I see in print.default() that if the prefix() argument is present we call 
> show() instead of the next method for print(). show() then calls print(). 
> However, the quote=F argument doesn't propagate to the print() call.
> 

print(matrix(...)) is still calling print.matrix. Try instead
print.default(matrix(...), quote = F)

Sundar

-- 
Sundar Dorai-Raj
PDF Solutions, Inc.
Dallas TX


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