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
|